Skip to content

Commit

Permalink
fix: fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dackmin committed Jun 11, 2020
1 parent a743238 commit 0be4ec6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/ColorField/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/ColorField/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('<ColorField />', () => {
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(<ColorField globalEventsTarget={document} />);
expect(map.mousemove).toBeDefined();
Expand Down
10 changes: 5 additions & 5 deletions lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,31 @@ 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,
a: isNaN(parseFloat(a)) ? 1 : parseFloat(a),
}),
}, {
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,
a: isNaN(parseFloat(a)) ? 1 : parseFloat(a),
}),
}, {
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,
a: 1,
}),
}, {
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,
Expand Down Expand Up @@ -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 }) => ({
Expand Down
7 changes: 2 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
} : {}),
})),
{
Expand Down

0 comments on commit 0be4ec6

Please sign in to comment.