mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-07-09 11:34:02 -04:00
Merge pull request #2051 from LLK/update-eslint-smore
Update eslint and babel-eslint, and fix resulting errors
This commit is contained in:
commit
96db8cde53
7 changed files with 845 additions and 546 deletions
1367
package-lock.json
generated
1367
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -50,7 +50,7 @@
|
|||
"autoprefixer": "9.7.4",
|
||||
"babel-cli": "6.26.0",
|
||||
"babel-core": "6.26.3",
|
||||
"babel-eslint": "8.2.6",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-jest": "23.6.0",
|
||||
"babel-loader": "7.1.5",
|
||||
"babel-plugin-react-intl": "3.0.1",
|
||||
|
@ -60,7 +60,7 @@
|
|||
"css-loader": "3.4.0",
|
||||
"enzyme": "3.11.0",
|
||||
"enzyme-adapter-react-16": "1.15.6",
|
||||
"eslint": "5.16.0",
|
||||
"eslint": "^7.13.0",
|
||||
"eslint-config-import": "0.13.0",
|
||||
"eslint-config-scratch": "7.0.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* eslint-disable import/no-commonjs */
|
||||
module.exports = {
|
||||
/* eslint-enable import/no-commonjs */
|
||||
root: true,
|
||||
extends: ['scratch', 'scratch/es6', 'scratch/react', 'import'],
|
||||
env: {
|
||||
|
|
|
@ -7,8 +7,9 @@ import {changeStrokeColor, changeStrokeColor2, changeStrokeGradientType} from '.
|
|||
import {changeStrokeWidth} from '../reducers/stroke-width';
|
||||
import StrokeWidthIndicatorComponent from '../components/stroke-width-indicator.jsx';
|
||||
import {getSelectedLeafItems} from '../helper/selection';
|
||||
import {applyColorToSelection, applyStrokeWidthToSelection, getColorsFromSelection, MIXED}
|
||||
from '../helper/style-path';
|
||||
import {
|
||||
applyColorToSelection, applyStrokeWidthToSelection, getColorsFromSelection, MIXED
|
||||
} from '../helper/style-path';
|
||||
import GradientTypes from '../lib/gradient-types';
|
||||
import Modes from '../lib/modes';
|
||||
import Formats, {isBitmap} from '../lib/format';
|
||||
|
|
|
@ -4,8 +4,9 @@ import {isGroup} from '../group';
|
|||
import {isCompoundPathItem, getRootItem} from '../item';
|
||||
import {checkPointsClose, snapDeltaToAngle} from '../math';
|
||||
import {getActionBounds, CENTER} from '../view';
|
||||
import {clearSelection, cloneSelection, getSelectedLeafItems, getSelectedRootItems, setItemSelection}
|
||||
from '../selection';
|
||||
import {
|
||||
clearSelection, cloneSelection, getSelectedLeafItems, getSelectedRootItems, setItemSelection
|
||||
} from '../selection';
|
||||
import {getDragCrosshairLayer, CROSSHAIR_FULL_OPACITY} from '../layer';
|
||||
|
||||
/** Snap to align selection center to rotation center within this distance */
|
||||
|
@ -127,7 +128,7 @@ class MoveTool {
|
|||
|
||||
point.x = Math.max(actionBounds.left, Math.min(point.x, actionBounds.right));
|
||||
point.y = Math.max(actionBounds.top, Math.min(point.y, actionBounds.bottom));
|
||||
|
||||
|
||||
const dragVector = point.subtract(event.downPoint);
|
||||
let snapVector;
|
||||
|
||||
|
@ -167,7 +168,7 @@ class MoveTool {
|
|||
bounds = item.bounds;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (this.firstDrag) {
|
||||
// Show the center crosshair above the selected item while dragging.
|
||||
getDragCrosshairLayer().visible = true;
|
||||
|
|
|
@ -633,8 +633,7 @@ const styleShape = function (path, options) {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('strokeWidth')) path.strokeWidth = options.strokeWidth;
|
||||
if (Object.prototype.hasOwnProperty.call(options, 'strokeWidth')) path.strokeWidth = options.strokeWidth;
|
||||
};
|
||||
|
||||
export {
|
||||
|
|
|
@ -14,6 +14,7 @@ test('initialState', () => {
|
|||
|
||||
test('changeBrushSize', () => {
|
||||
let defaultState;
|
||||
|
||||
const newBrushSize = 8078;
|
||||
|
||||
expect(brushReducer(defaultState /* state */, changeBrushSize(newBrushSize) /* action */))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue