From 2c64c4510157534d96630bac68d7cffb87278d62 Mon Sep 17 00:00:00 2001 From: DD Date: Tue, 29 Aug 2017 17:24:40 -0400 Subject: [PATCH] fix lint errors --- src/containers/blob/blob.js | 6 +++--- src/containers/blob/broad-brush-helper.js | 2 +- src/containers/blob/segment-brush-helper.js | 6 +++--- test/unit/modes-reducer.test.js | 2 +- webpack.config.js | 15 +++++++-------- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/containers/blob/blob.js b/src/containers/blob/blob.js index b06199b8..bc7f63d1 100644 --- a/src/containers/blob/blob.js +++ b/src/containers/blob/blob.js @@ -64,7 +64,7 @@ class Blobbiness { this.tool.onMouseDown = function (event) { blob.resizeCursorIfNeeded(event.point); - if (event.event.button > 0) return; // only first mouse button + if (event.event.button > 0) return; // only first mouse button if (blob.options.brushSize < Blobbiness.THRESHOLD) { blob.brush = Blobbiness.BROAD; @@ -80,7 +80,7 @@ class Blobbiness { this.tool.onMouseDrag = function (event) { blob.resizeCursorIfNeeded(event.point); - if (event.event.button > 0) return; // only first mouse button + if (event.event.button > 0) return; // only first mouse button if (blob.brush === Blobbiness.BROAD) { blob.broadBrushHelper.onBroadMouseDrag(event, blob.tool, blob.options); } else if (blob.brush === Blobbiness.SEGMENT) { @@ -96,7 +96,7 @@ class Blobbiness { this.tool.onMouseUp = function (event) { blob.resizeCursorIfNeeded(event.point); - if (event.event.button > 0) return; // only first mouse button + if (event.event.button > 0) return; // only first mouse button let lastPath; if (blob.brush === Blobbiness.BROAD) { diff --git a/src/containers/blob/broad-brush-helper.js b/src/containers/blob/broad-brush-helper.js index b3bc1ca3..c9cfee25 100644 --- a/src/containers/blob/broad-brush-helper.js +++ b/src/containers/blob/broad-brush-helper.js @@ -22,7 +22,7 @@ class BroadBrushHelper { onBroadMouseDown (event, tool, options) { tool.minDistance = options.brushSize / 2; tool.maxDistance = options.brushSize; - if (event.event.button > 0) return; // only first mouse button + if (event.event.button > 0) return; // only first mouse button this.finalPath = new paper.Path(); stylePath(this.finalPath, options.isEraser); diff --git a/src/containers/blob/segment-brush-helper.js b/src/containers/blob/segment-brush-helper.js index 88f7debd..c745b9d8 100644 --- a/src/containers/blob/segment-brush-helper.js +++ b/src/containers/blob/segment-brush-helper.js @@ -22,7 +22,7 @@ class SegmentBrushHelper { } onSegmentMouseDown (event, tool, options) { - if (event.event.button > 0) return; // only first mouse button + if (event.event.button > 0) return; // only first mouse button tool.minDistance = 1; tool.maxDistance = options.brushSize; @@ -37,7 +37,7 @@ class SegmentBrushHelper { } onSegmentMouseDrag (event, tool, options) { - if (event.event.button > 0) return; // only first mouse button + if (event.event.button > 0) return; // only first mouse button const step = (event.delta).normalize(options.brushSize / 2); const handleVec = step.clone(); @@ -75,7 +75,7 @@ class SegmentBrushHelper { } onSegmentMouseUp (event) { - if (event.event.button > 0) return; // only first mouse button + if (event.event.button > 0) return; // only first mouse button // TODO: This smoothing tends to cut off large portions of the path! Would like to eventually // add back smoothing, maybe a custom implementation that only applies to a subset of the line? diff --git a/test/unit/modes-reducer.test.js b/test/unit/modes-reducer.test.js index 8f08ffc9..df81f64c 100644 --- a/test/unit/modes-reducer.test.js +++ b/test/unit/modes-reducer.test.js @@ -19,6 +19,6 @@ test('changeMode', () => { test('invalidChangeMode', () => { expect(reducer(Modes.BRUSH /* state */, changeMode('non-existant mode') /* action */)) - .toBe(Modes.BRUSH); + .toBe(Modes.BRUSH); expect(reducer(Modes.BRUSH /* state */, changeMode() /* action */)).toBe(Modes.BRUSH); }); diff --git a/webpack.config.js b/webpack.config.js index 2b093a84..fd5935d6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,3 @@ - const defaultsDeep = require('lodash.defaultsdeep'); const path = require('path'); const webpack = require('webpack'); @@ -53,12 +52,12 @@ const base = { }] }, plugins: [] - .concat(process.env.NODE_ENV === 'production' ? [ - new webpack.optimize.UglifyJsPlugin({ - include: /\.min\.js$/, - minimize: true - }) - ] : []) + .concat(process.env.NODE_ENV === 'production' ? [ + new webpack.optimize.UglifyJsPlugin({ + include: /\.min\.js$/, + minimize: true + }) + ] : []) }; module.exports = [ @@ -96,7 +95,7 @@ module.exports = [ output: { path: path.resolve(__dirname, 'dist'), filename: '[name].js', - libraryTarget: 'commonjs2', + libraryTarget: 'commonjs2' } }) ];