Skip to content

Commit c86f531

Browse files
committed
Updated packages related to eslint
1 parent 574f89e commit c86f531

32 files changed

+757
-1506
lines changed

.eslintrc

-7
This file was deleted.

.eslintrc.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
extends: ['jss'],
4+
globals: {
5+
benchmark: true
6+
},
7+
env: {
8+
mocha: true,
9+
browser: true
10+
},
11+
}

package.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,8 @@
5353
"caniuse-support": "^0.4.3",
5454
"cross-env": "^5.2.0",
5555
"es5-shim": "^4.5.10",
56-
"eslint": "^5.0.1",
57-
"eslint-config-airbnb": "^17.0.0",
58-
"eslint-config-jss": "^3.0.0",
59-
"eslint-plugin-import": "^2.13.0",
60-
"eslint-plugin-jsx-a11y": "^6.0.3",
61-
"eslint-plugin-react": "^7.10.0",
56+
"eslint": "^5.13.0",
57+
"eslint-config-jss": "^5.0.1",
6258
"expect.js": "^0.3.1",
6359
"karma": "^3.1.4",
6460
"karma-benchmark": "^1.0.0",

src/index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
* @license MIT
77
*/
88

9-
import prefix from './prefix'
10-
import supportedKeyframes from './supported-keyframes'
11-
import supportedProperty from './supported-property'
12-
import supportedValue from './supported-value'
9+
import prefix from './prefix';
10+
import supportedKeyframes from './supported-keyframes';
11+
import supportedProperty from './supported-property';
12+
import supportedValue from './supported-value';
1313

1414
export {
1515
prefix,
1616
supportedKeyframes,
1717
supportedProperty,
18-
supportedValue
19-
}
18+
supportedValue,
19+
};

src/index.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {currentBrowser} from 'caniuse-support'
1+
import { currentBrowser } from 'caniuse-support';
22

3-
const msg = `Detected browser: ${currentBrowser.id} ${currentBrowser.version}`
4-
console.log(msg) // eslint-disable-line no-console
3+
const msg = `Detected browser: ${currentBrowser.id} ${currentBrowser.version}`;
4+
console.log(msg); // eslint-disable-line no-console

src/plugins/appearence.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import prefix from '../prefix'
1+
import prefix from '../prefix';
22

33
// Support old appearance props syntax.
44
// https://caniuse.com/#search=appearance
55
export default {
66
noPrefill: ['appearance'],
77
supportedProperty: (prop) => {
8-
if (prop !== 'appearance') return false
9-
if (prefix.js === 'ms') return `-webkit-${prop}`
10-
return prefix.css + prop
11-
}
12-
}
8+
if (prop !== 'appearance') return false;
9+
if (prefix.js === 'ms') return `-webkit-${prop}`;
10+
return prefix.css + prop;
11+
},
12+
};

src/plugins/break-props-old.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import prefix from '../prefix'
2-
import pascalize from '../utils/pascalize'
1+
import prefix from '../prefix';
2+
import pascalize from '../utils/pascalize';
33

44
// Support old break-* props syntax.
55
// https://caniuse.com/#search=multicolumn
66
// https://github.com/postcss/autoprefixer/issues/491
77
// https://github.com/postcss/autoprefixer/issues/177
88
export default {
99
supportedProperty: (prop, style) => {
10-
if (!/^break-/.test(prop)) return false
10+
if (!/^break-/.test(prop)) return false;
1111
if (prefix.js === 'Webkit') {
12-
const jsProp = `WebkitColumn${pascalize(prop)}`
13-
return jsProp in style ? `${prefix.css}column-${prop}` : false
12+
const jsProp = `WebkitColumn${pascalize(prop)}`;
13+
return jsProp in style ? `${prefix.css}column-${prop}` : false;
1414
}
1515
if (prefix.js === 'Moz') {
16-
const jsProp = `page${pascalize(prop)}`
17-
return jsProp in style ? `page-${prop}` : false
16+
const jsProp = `page${pascalize(prop)}`;
17+
return jsProp in style ? `page-${prop}` : false;
1818
}
19-
return false
20-
}
21-
}
19+
return false;
20+
},
21+
};

src/plugins/color-adjust.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import prefix from '../prefix'
1+
import prefix from '../prefix';
22

33
// Support old color-adjust prop syntax.
44
// https://caniuse.com/#search=color-adjust
55
export default {
66
noPrefill: ['color-adjust'],
77
supportedProperty: (prop) => {
8-
if (prop !== 'color-adjust') return false
9-
if (prefix.js === 'Webkit') return `${prefix.css}print-${prop}`
10-
return prop
11-
}
12-
}
8+
if (prop !== 'color-adjust') return false;
9+
if (prefix.js === 'Webkit') return `${prefix.css}print-${prop}`;
10+
return prop;
11+
},
12+
};

src/plugins/flex-2009.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import prefix from '../prefix'
2-
import pascalize from '../utils/pascalize'
1+
import prefix from '../prefix';
2+
import pascalize from '../utils/pascalize';
33

44
const propMap = {
55
flex: 'box-flex',
@@ -9,28 +9,28 @@ const propMap = {
99
'align-items': 'box-align',
1010
'flex-flow': ['box-orient', 'box-direction'],
1111
'justify-content': 'box-pack',
12-
}
12+
};
1313

14-
const propKeys = Object.keys(propMap)
14+
const propKeys = Object.keys(propMap);
1515

16-
const prefixCss = p => prefix.css + p
16+
const prefixCss = p => prefix.css + p;
1717

1818
// Support old flex spec from 2009.
1919
export default {
20-
supportedProperty: (prop, style, {multiple}) => {
20+
supportedProperty: (prop, style, { multiple }) => {
2121
if (propKeys.indexOf(prop) > -1) {
22-
const newProp = propMap[prop]
22+
const newProp = propMap[prop];
2323
if (!Array.isArray(newProp)) {
24-
return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false
24+
return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
2525
}
26-
if (!multiple) return false
26+
if (!multiple) return false;
2727
for (let i = 0; i < newProp.length; i++) {
2828
if (!(prefix.js + pascalize(newProp[0]) in style)) {
29-
return false
29+
return false;
3030
}
3131
}
32-
return newProp.map(prefixCss)
32+
return newProp.map(prefixCss);
3333
}
34-
return false
35-
}
36-
}
34+
return false;
35+
},
36+
};

src/plugins/flex-2012.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import prefix from '../prefix'
2-
import pascalize from '../utils/pascalize'
1+
import prefix from '../prefix';
2+
import pascalize from '../utils/pascalize';
33

44
const propMap = {
55
'flex-grow': 'flex-positive',
@@ -10,13 +10,13 @@ const propMap = {
1010
'align-items': 'flex-align',
1111
'align-content': 'flex-line-pack',
1212
// 'align-self' is handled by 'align-self' plugin.
13-
}
13+
};
1414

1515
// Support old flex spec from 2012.
1616
export default {
1717
supportedProperty: (prop, style) => {
18-
const newProp = propMap[prop]
19-
if (!newProp) return false
20-
return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false
21-
}
22-
}
18+
const newProp = propMap[prop];
19+
if (!newProp) return false;
20+
return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
21+
},
22+
};

src/plugins/index.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import appearence from './appearence'
2-
import breakPropsOld from './break-props-old'
3-
import colorAdjust from './color-adjust'
4-
import flex2009 from './flex-2009'
5-
import flex2012 from './flex-2012'
6-
import inlineLogicalOld from './inline-logical-old'
7-
import mask from './mask'
8-
import prefixed from './prefixed'
9-
import scrollSnap from './scroll-snap'
10-
import overscrollBehavior from './overscroll-behavior'
11-
import transform from './transform'
12-
import transition from './transition'
13-
import unprefixed from './unprefixed'
14-
import writingMode from './writing-mode'
1+
import appearence from './appearence';
2+
import breakPropsOld from './break-props-old';
3+
import colorAdjust from './color-adjust';
4+
import flex2009 from './flex-2009';
5+
import flex2012 from './flex-2012';
6+
import inlineLogicalOld from './inline-logical-old';
7+
import mask from './mask';
8+
import prefixed from './prefixed';
9+
import scrollSnap from './scroll-snap';
10+
import overscrollBehavior from './overscroll-behavior';
11+
import transform from './transform';
12+
import transition from './transition';
13+
import unprefixed from './unprefixed';
14+
import writingMode from './writing-mode';
1515

1616
// Please, keep order plugins:
1717
// plugins = [
@@ -43,15 +43,15 @@ const plugins = [
4343
overscrollBehavior,
4444
flex2012,
4545
flex2009,
46-
]
46+
];
4747

4848
export const propertyDetectors = plugins
4949
.filter(p => p.supportedProperty)
50-
.map(p => p.supportedProperty)
50+
.map(p => p.supportedProperty);
5151

5252
export const noPrefill = plugins
5353
.filter(p => p.noPrefill)
5454
.reduce((a, p) => {
55-
a.push(...p.noPrefill)
56-
return a
57-
}, [])
55+
a.push(...p.noPrefill);
56+
return a;
57+
}, []);

src/plugins/inline-logical-old.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import prefix from '../prefix'
2-
import pascalize from '../utils/pascalize'
1+
import prefix from '../prefix';
2+
import pascalize from '../utils/pascalize';
33

44
// Support old inline-logical syntax.
55
// See https://github.com/postcss/autoprefixer/issues/324.
66
export default {
77
supportedProperty: (prop, style) => {
8-
if (!/^(border|margin|padding)-inline/.test(prop)) return false
9-
if (prefix.js === 'Moz') return prop
10-
const newProp = prop.replace('-inline', '')
11-
return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false
12-
}
13-
}
8+
if (!/^(border|margin|padding)-inline/.test(prop)) return false;
9+
if (prefix.js === 'Moz') return prop;
10+
const newProp = prop.replace('-inline', '');
11+
return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
12+
},
13+
};

src/plugins/mask.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import prefix from '../prefix'
2-
import pascalize from '../utils/pascalize'
3-
import camelize from '../utils/camelize'
1+
import prefix from '../prefix';
2+
import pascalize from '../utils/pascalize';
3+
import camelize from '../utils/camelize';
44

55
// Mask property support cannot detect directly in WebKit browsers,
66
// but we can use a longhand property instead.
77
// https://caniuse.com/#search=mask
88
export default {
99
noPrefill: ['mask'],
1010
supportedProperty: (prop, style) => {
11-
if (!/^mask/.test(prop)) return false
11+
if (!/^mask/.test(prop)) return false;
1212
if (prefix.js === 'Webkit') {
13-
const longhand = 'mask-image'
13+
const longhand = 'mask-image';
1414
if (camelize(longhand) in style) {
15-
return prop
15+
return prop;
1616
}
1717
if (prefix.js + pascalize(longhand) in style) {
18-
return prefix.css + prop
18+
return prefix.css + prop;
1919
}
2020
}
21-
return prop
22-
}
23-
}
21+
return prop;
22+
},
23+
};

src/plugins/overscroll-behavior.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import prefix from '../prefix'
1+
import prefix from '../prefix';
22

33
// Support overscroll-behavior props syntax.
44
// https://caniuse.com/#search=overscroll-behavior
55
export default {
66
supportedProperty: (prop) => {
7-
if (prop !== 'overscroll-behavior') return false
7+
if (prop !== 'overscroll-behavior') return false;
88
if (prefix.js === 'ms') {
9-
return `${prefix.css}scroll-chaining`
9+
return `${prefix.css}scroll-chaining`;
1010
}
11-
return prop
12-
}
13-
}
11+
return prop;
12+
},
13+
};

src/plugins/prefixed.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import prefix from '../prefix'
2-
import pascalize from '../utils/pascalize'
1+
import prefix from '../prefix';
2+
import pascalize from '../utils/pascalize';
33

44
// Test if property is supported with vendor prefix.
55
export default {
66
supportedProperty: (prop, style) => {
7-
const pascalized = pascalize(prop)
8-
if (prefix.js + pascalized in style) return prefix.css + prop
7+
const pascalized = pascalize(prop);
8+
if (prefix.js + pascalized in style) return prefix.css + prop;
99
// Try webkit fallback.
10-
if (prefix.js !== 'Webkit' && `Webkit${pascalized}` in style) return prop
11-
return false
12-
}
13-
}
10+
if (prefix.js !== 'Webkit' && `Webkit${pascalized}` in style) return prop;
11+
return false;
12+
},
13+
};

src/plugins/scroll-snap.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import prefix from '../prefix'
1+
import prefix from '../prefix';
22

33
// Support scroll-snap props syntax.
44
// https://caniuse.com/#search=scroll-snap
55
export default {
66
supportedProperty: (prop) => {
7-
if (prop.substring(0, 11) !== 'scroll-snap') return false
7+
if (prop.substring(0, 11) !== 'scroll-snap') return false;
88
if (prefix.js === 'ms') {
9-
return `${prefix.css}${prop}`
9+
return `${prefix.css}${prop}`;
1010
}
11-
return prop
12-
}
13-
}
11+
return prop;
12+
},
13+
};

0 commit comments

Comments
 (0)