Update eslint and fix duplicate import errors

This commit is contained in:
Paul Kaplan 2021-02-09 12:14:00 -05:00
parent 885939d3f9
commit 7ab106ee27
29 changed files with 51 additions and 67 deletions

View file

@ -60,9 +60,9 @@
"css-loader": "3.4.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
"eslint": "^4.4.1",
"eslint": "^5.7.0",
"eslint-config-import": "^0.13.0",
"eslint-config-scratch": "^5.0.0",
"eslint-config-scratch": "^6.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-react": "7.20.3",
"gh-pages": "github:rschamp/gh-pages#publish-branch-to-subfolder",

View file

@ -12,12 +12,11 @@ import Button from '../button/button.jsx';
import ButtonGroup from '../button-group/button-group.jsx';
import Dropdown from '../dropdown/dropdown.jsx';
import {defineMessages, injectIntl, intlShape} from 'react-intl';
import Formats from '../../lib/format';
import Formats, {isVector} from '../../lib/format';
import Input from '../forms/input.jsx';
import InputGroup from '../input-group/input-group.jsx';
import Label from '../forms/label.jsx';
import LabeledIconButton from '../labeled-icon-button/labeled-icon-button.jsx';
import {isVector} from '../../lib/format';
import layout from '../../lib/layout-constants';
import {hideLabel} from '../../lib/hide-label';
import styles from './fixed-tools.css';

View file

@ -17,8 +17,7 @@ import Input from '../forms/input.jsx';
import InputGroup from '../input-group/input-group.jsx';
import LabeledIconButton from '../labeled-icon-button/labeled-icon-button.jsx';
import Modes from '../../lib/modes';
import Formats from '../../lib/format';
import {isBitmap, isVector} from '../../lib/format';
import Formats, {isBitmap, isVector} from '../../lib/format';
import {hideLabel} from '../../lib/hide-label';
import styles from './mode-tools.css';

View file

@ -34,8 +34,7 @@ import StrokeColorIndicatorComponent from '../../containers/stroke-color-indicat
import StrokeWidthIndicatorComponent from '../../containers/stroke-width-indicator.jsx';
import TextMode from '../../containers/text-mode.jsx';
import Formats from '../../lib/format';
import {isBitmap, isVector} from '../../lib/format';
import Formats, {isBitmap, isVector} from '../../lib/format';
import styles from './paint-editor.css';
import bitmapIcon from './icons/bitmap.svg';

View file

@ -5,8 +5,7 @@ import parseColor from 'parse-color';
import {injectIntl, intlShape} from 'react-intl';
import {getSelectedLeafItems} from '../helper/selection';
import Formats from '../lib/format';
import {isBitmap} from '../lib/format';
import Formats, {isBitmap} from '../lib/format';
import GradientTypes from '../lib/gradient-types';
import ColorIndicatorComponent from '../components/color-indicator.jsx';

View file

@ -15,8 +15,7 @@ import {getSelectedLeafItems} from '../helper/selection';
import {bringToFront, sendBackward, sendToBack, bringForward} from '../helper/order';
import {groupSelection, ungroupSelection} from '../helper/group';
import Formats from '../lib/format';
import {isBitmap} from '../lib/format';
import Formats, {isBitmap} from '../lib/format';
import bindAll from 'lodash.bindall';
class FixedTools extends React.Component {

View file

@ -8,12 +8,11 @@ import ColorStyleProptype from '../lib/color-style-proptype';
import {clearSelection} from '../helper/selection';
import {endPointHit, touching} from '../helper/snapping';
import {drawHitPoint, removeHitPoint} from '../helper/guides';
import {styleShape} from '../helper/style-path';
import {styleShape, MIXED} from '../helper/style-path';
import {changeStrokeColor, clearStrokeGradient} from '../reducers/stroke-style';
import {changeStrokeWidth} from '../reducers/stroke-width';
import {changeMode} from '../reducers/modes';
import {clearSelectedItems} from '../reducers/selected-items';
import {MIXED} from '../helper/style-path';
import {snapDeltaToAngle} from '../helper/math';
import LineModeComponent from '../components/line-mode/line-mode.jsx';

View file

@ -18,8 +18,7 @@ import {
import {HANDLE_RATIO, ensureClockwise} from '../helper/math';
import {getRaster} from '../helper/layer';
import {flipBitmapHorizontal, flipBitmapVertical, selectAllBitmap} from '../helper/bitmap';
import {isBitmap} from '../lib/format';
import Formats from '../lib/format';
import Formats, {isBitmap} from '../lib/format';
import Modes from '../lib/modes';
class ModeTools extends React.Component {

View file

@ -23,10 +23,8 @@ import {convertToBitmap, convertToVector} from '../helper/bitmap';
import {resetZoom, zoomOnSelection, OUTERMOST_ZOOM_LEVEL} from '../helper/view';
import EyeDropperTool from '../helper/tools/eye-dropper';
import Modes from '../lib/modes';
import {BitmapModes, VectorModes} from '../lib/modes';
import Formats from '../lib/format';
import {isBitmap, isVector} from '../lib/format';
import Modes, {BitmapModes, VectorModes} from '../lib/modes';
import Formats, {isBitmap, isVector} from '../lib/format';
import bindAll from 'lodash.bindall';
/**

View file

@ -11,8 +11,10 @@ import {undoSnapshot, clearUndoState} from '../reducers/undo';
import {isGroup, ungroupItems} from '../helper/group';
import {clearRaster, convertBackgroundGuideLayer, getRaster, setupLayers} from '../helper/layer';
import {clearSelectedItems} from '../reducers/selected-items';
import {ART_BOARD_WIDTH, ART_BOARD_HEIGHT, CENTER, MAX_WORKSPACE_BOUNDS} from '../helper/view';
import {clampViewBounds, resetZoom, setWorkspaceBounds, zoomToFit, resizeCrosshair} from '../helper/view';
import {
ART_BOARD_WIDTH, ART_BOARD_HEIGHT, CENTER, MAX_WORKSPACE_BOUNDS,
clampViewBounds, resetZoom, setWorkspaceBounds, zoomToFit, resizeCrosshair
} from '../helper/view';
import {ensureClockwise, scaleWithStrokes} from '../helper/math';
import {clearHoveredItem} from '../reducers/hover';
import {clearPasteOffset} from '../reducers/clipboard';

View file

@ -2,9 +2,8 @@ import {connect} from 'react-redux';
import {defineMessages} from 'react-intl';
import {changeColorIndex} from '../reducers/color-index';
import {changeStrokeColor, changeStrokeColor2} from '../reducers/stroke-style';
import {changeStrokeColor, changeStrokeColor2, changeStrokeGradientType} from '../reducers/stroke-style';
import {changeStrokeWidth} from '../reducers/stroke-width';
import {changeStrokeGradientType} from '../reducers/stroke-style';
import {openStrokeColor, closeStrokeColor} from '../reducers/modals';
import {getSelectedLeafItems} from '../helper/selection';
import {setSelectedItems} from '../reducers/selected-items';

View file

@ -11,8 +11,7 @@ import {applyColorToSelection, applyStrokeWidthToSelection, getColorsFromSelecti
from '../helper/style-path';
import GradientTypes from '../lib/gradient-types';
import Modes from '../lib/modes';
import Formats from '../lib/format';
import {isBitmap} from '../lib/format';
import Formats, {isBitmap} from '../lib/format';
class StrokeWidthIndicator extends React.Component {
constructor (props) {

View file

@ -1,7 +1,6 @@
import paper from '@scratch/paper';
import {getRaster} from '../layer';
import {getRaster, getGuideLayer} from '../layer';
import {forEachLinePoint, getBrushMark} from '../bitmap';
import {getGuideLayer} from '../layer';
/**
* Tool for drawing with the bitmap brush and eraser

View file

@ -1,7 +1,6 @@
import paper from '@scratch/paper';
import {getRaster} from '../layer';
import {getRaster, createCanvas, getGuideLayer} from '../layer';
import {forEachLinePoint, getBrushMark} from '../bitmap';
import {createCanvas, getGuideLayer} from '../layer';
import {ART_BOARD_WIDTH, ART_BOARD_HEIGHT} from '../view';
/**

View file

@ -1,6 +1,5 @@
import paper from '@scratch/paper';
import Modes from '../../lib/modes';
import {BitmapModes} from '../../lib/modes';
import Modes, {BitmapModes} from '../../lib/modes';
import {isGroup} from '../group';
import {isCompoundPathItem, getRootItem} from '../item';
import {checkPointsClose, snapDeltaToAngle} from '../math';

View file

@ -1,8 +1,7 @@
import paper from '@scratch/paper';
import {getSelectedLeafItems} from './selection';
import {getSelectedLeafItems, getItems} from './selection';
import {isPointTextItem} from './item';
import {isGroup} from './group';
import {getItems} from './selection';
import GradientTypes from '../lib/gradient-types';
import {DEFAULT_COLOR} from '../reducers/fill-style';
import {isCompoundPathChild} from '../helper/compound-path';

View file

@ -3,8 +3,7 @@
import paper from '@scratch/paper';
import {hideGuideLayers, showGuideLayers, getRaster} from '../helper/layer';
import {getSelectedLeafItems} from '../helper/selection';
import Formats from '../lib/format';
import {isVector, isBitmap} from '../lib/format';
import Formats, {isVector, isBitmap} from '../lib/format';
import log from '../log/log';
/**

View file

@ -12,8 +12,7 @@ import {
getSelectedRootItems
} from '../helper/selection';
import {getTrimmedRaster} from '../helper/bitmap';
import {isBitmap} from '../lib/format';
import Formats from '../lib/format';
import Formats, {isBitmap} from '../lib/format';
import Modes from '../lib/modes';
import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items';

View file

@ -13,8 +13,7 @@ import {groupSelection, shouldShowGroup, ungroupSelection, shouldShowUngroup} fr
import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items';
import {changeMode} from '../reducers/modes';
import {isBitmap} from '../lib/format';
import Formats from '../lib/format';
import Formats, {isBitmap} from '../lib/format';
import Modes from '../lib/modes';
const KeyboardShortcutsHOC = function (WrappedComponent) {

View file

@ -6,11 +6,12 @@ import {connect} from 'react-redux';
import {getSelectedLeafItems} from '../helper/selection';
import {setSelectedItems} from '../reducers/selected-items';
import {performUndo, performRedo, shouldShowUndo, shouldShowRedo} from '../helper/undo';
import {
performUndo, performRedo, shouldShowUndo, shouldShowRedo
} from '../helper/undo';
import {undo, redo} from '../reducers/undo';
import {isBitmap} from '../lib/format';
import Formats from '../lib/format';
import Formats, {isBitmap} from '../lib/format';
const UndoHOC = function (WrappedComponent) {
class UndoWrapper extends React.Component {

View file

@ -16,13 +16,13 @@ import {commitRectToBitmap, commitOvalToBitmap, commitSelectionToBitmap, getHitB
import {performSnapshot} from '../helper/undo';
import {scaleWithStrokes} from '../helper/math';
import {ART_BOARD_WIDTH, ART_BOARD_HEIGHT, SVG_ART_BOARD_WIDTH, SVG_ART_BOARD_HEIGHT} from '../helper/view';
import {setWorkspaceBounds} from '../helper/view';
import {
ART_BOARD_WIDTH, ART_BOARD_HEIGHT, SVG_ART_BOARD_WIDTH, SVG_ART_BOARD_HEIGHT,
setWorkspaceBounds
} from '../helper/view';
import Modes from '../lib/modes';
import {BitmapModes} from '../lib/modes';
import Formats from '../lib/format';
import {isBitmap, isVector} from '../lib/format';
import Modes, {BitmapModes} from '../lib/modes';
import Formats, {isBitmap, isVector} from '../lib/format';
const UpdateImageHOC = function (WrappedComponent) {
class UpdateImageWrapper extends React.Component {

View file

@ -1,8 +1,6 @@
/* eslint-env jest */
import brushReducer from '../../src/reducers/brush-mode';
import {changeBrushSize} from '../../src/reducers/brush-mode';
import eraserReducer from '../../src/reducers/eraser-mode';
import {changeBrushSize as changeEraserSize} from '../../src/reducers/eraser-mode';
import brushReducer, {changeBrushSize} from '../../src/reducers/brush-mode';
import eraserReducer, {changeBrushSize as changeEraserSize} from '../../src/reducers/eraser-mode';
test('initialState', () => {
let defaultState;

View file

@ -1,6 +1,7 @@
/* eslint-env jest */
import clipboardReducer from '../../src/reducers/clipboard';
import {clearPasteOffset, incrementPasteOffset, setClipboardItems} from '../../src/reducers/clipboard';
import clipboardReducer, {
clearPasteOffset, incrementPasteOffset, setClipboardItems
} from '../../src/reducers/clipboard';
test('initialState', () => {
let defaultState;

View file

@ -1,7 +1,6 @@
/* eslint-env jest */
import Formats from '../../src/lib/format';
import reducer from '../../src/reducers/format';
import {changeFormat} from '../../src/reducers/format';
import reducer, {changeFormat} from '../../src/reducers/format';
import {undo, redo} from '../../src/reducers/undo';
test('initialState', () => {

View file

@ -1,6 +1,5 @@
/* eslint-env jest */
import reducer from '../../src/reducers/hover';
import {clearHoveredItem, setHoveredItem} from '../../src/reducers/hover';
import reducer, {clearHoveredItem, setHoveredItem} from '../../src/reducers/hover';
test('initialState', () => {
let defaultState;

View file

@ -1,7 +1,6 @@
/* eslint-env jest */
import Modes from '../../src/lib/modes';
import reducer from '../../src/reducers/modes';
import {changeMode} from '../../src/reducers/modes';
import reducer, {changeMode} from '../../src/reducers/modes';
test('initialState', () => {
let defaultState;

View file

@ -1,6 +1,7 @@
/* eslint-env jest */
import selectedItemsReducer from '../../src/reducers/selected-items';
import {setSelectedItems, clearSelectedItems} from '../../src/reducers/selected-items';
import selectedItemsReducer, {
setSelectedItems, clearSelectedItems
} from '../../src/reducers/selected-items';
test('initialState', () => {
let defaultState;

View file

@ -1,6 +1,7 @@
/* eslint-env jest */
import strokeWidthReducer from '../../src/reducers/stroke-width';
import {MAX_STROKE_WIDTH, changeStrokeWidth} from '../../src/reducers/stroke-width';
import strokeWidthReducer, {
MAX_STROKE_WIDTH, changeStrokeWidth
} from '../../src/reducers/stroke-width';
import {setSelectedItems} from '../../src/reducers/selected-items';
import {mockPaperRootItem} from '../__mocks__/paperMocks';

View file

@ -1,6 +1,7 @@
/* eslint-env jest */
import undoReducer from '../../src/reducers/undo';
import {undoSnapshot, undo, redo, clearUndoState, MAX_STACK_SIZE} from '../../src/reducers/undo';
import undoReducer, {
undoSnapshot, undo, redo, clearUndoState, MAX_STACK_SIZE
} from '../../src/reducers/undo';
test('initialState', () => {
let defaultState;