diff --git a/lib/ColorField/index.js b/lib/ColorField/index.js index ea7386e68..647fe98e5 100644 --- a/lib/ColorField/index.js +++ b/lib/ColorField/index.js @@ -205,7 +205,7 @@ const ColorField = forwardRef(({ onChange({ value: state.value, valid: true }); }; - const onMouseUp_ = e => { + const onMouseUp_ = () => { /* istanbul ignore if: just in case */ if (!state.handleMoving || !state.handleType || disabled || readOnly) { return; diff --git a/lib/ColorField/index.test.js b/lib/ColorField/index.test.js index a0d994440..13056f518 100644 --- a/lib/ColorField/index.test.js +++ b/lib/ColorField/index.test.js @@ -62,7 +62,7 @@ describe('', () => { it('should remove document events on unmount', () => { const map = {}; document.addEventListener = (event, cb) => { map[event] = sinon.spy(cb); }; - document.removeEventListener = (event, cb) => delete map[event]; + document.removeEventListener = event => delete map[event]; const component = mount(); expect(map.mousemove).toBeDefined(); diff --git a/lib/utils/index.js b/lib/utils/index.js index 28a16f664..90cd9a453 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -41,7 +41,7 @@ export const ensureNode = selectorOrNode => ( export const COLOR_PARSERS = [{ regex: /(rgb)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*%?,\s*(\d{1,3})\s*%?(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, - parse: ([useless, alsoUseless, r, g, b, a]) => ({ + parse: ([_useless, _alsoUseless, r, g, b, a]) => ({ r: parseInt(r, 10) / 255, g: parseInt(g, 10) / 255, b: parseInt(b, 10) / 255, @@ -49,7 +49,7 @@ export const COLOR_PARSERS = [{ }), }, { regex: /(hsl)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, - parse: ([useless, alsoUseless, h, s, l, a]) => ({ + parse: ([_useless, _alsoUseless, h, s, l, a]) => ({ h: parseInt(h, 10) / 360, s: parseInt(s, 10) / 100, l: parseInt(l, 10) / 100, @@ -57,7 +57,7 @@ export const COLOR_PARSERS = [{ }), }, { regex: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/, - parse: ([useless, r, g, b]) => ({ + parse: ([_useless, r, g, b]) => ({ r: parseInt(r, 16) / 255, g: parseInt(g, 16) / 255, b: parseInt(b, 16) / 255, @@ -65,7 +65,7 @@ export const COLOR_PARSERS = [{ }), }, { regex: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/, - parse: ([useless, r, g, b]) => ({ + parse: ([_useless, r, g, b]) => ({ r: parseInt(r + r, 16) / 255, g: parseInt(g + g, 16) / 255, b: parseInt(b + b, 16) / 255, @@ -191,7 +191,7 @@ export const rgba2hsva = ({ r, g, b, a = 0 } = {}) => { return { h, s, v, a }; }; -export const rgba2hex = ({ r, g, b, a }) => +export const rgba2hex = ({ r, g, b }) => '#' + ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).substr(1); export const denormalizeHSLA = ({ h, s, l, a }) => ({ diff --git a/rollup.config.js b/rollup.config.js index 23b3339d0..b1056c51e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -50,11 +50,8 @@ export default [ globals: defaultGlobals, }, ...(f === 'esm' ? { - manualChunks: id => { - return id.includes('node_modules') - ? 'vendor' - : path.parse(id).name; - }, + manualChunks: id => + id.includes('node_modules') ? 'vendor' : path.parse(id).name, } : {}), })), {