-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.eslintrc.js
59 lines (59 loc) · 2.06 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Our rules are based on the defaults provided by XO
// https://github.com/sindresorhus/xo
// eslint-disable-next-line import/no-commonjs
module.exports = {
root: true,
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
globals: {
window: true,
document: true
},
parserOptions: {
ecmaVersion: 2017
},
plugins: [
// https://github.com/dustinspecker/eslint-plugin-no-use-extend-native
'no-use-extend-native',
// https://github.com/avajs/eslint-plugin-ava
'unicorn',
// https://www.npmjs.com/package/eslint-plugin-promise
'promise',
// https://www.npmjs.com/package/eslint-config-import
'import'
],
extends: [
'xo/esnext',
'plugin:unicorn/recommended'
],
rules: {
// We've transitioned from tabs to four spaces
'no-tabs': [ 'error' ],
indent: [ 'error', 4 ],
// Use import, not require
'import/no-commonjs': 'error',
// Allow for: "ComponentName.test.js" instead of "component-name.test.js"
'unicorn/filename-case': 0,
// Enables using eslint-disable at the top of a file to ignore the whole file.
// useful for development and quick prototypes.
'unicorn/no-abusive-eslint-disable': 0,
// Allow for todo comments
'no-warning-comments': 0,
// Readability: { spacing } and [ spacing ].
'object-curly-spacing': [ 'error', 'always' ],
// Readability: [[ 1, 2 ], 2, [ 3, 4 ]]
'array-bracket-spacing': [ 'error', 'always', { arraysInArrays: false } ],
// Good: (x) => { ... }, Bad: x => { ... }
'arrow-parens': [ 'error', 'always' ],
// Multi-line ternary ? and : operator at beginning of the line
'operator-linebreak': [ 'error', 'after', { overrides: { '?': 'before', ':': 'before' } } ],
// Allow debugger statements
'no-debugger': 'warn',
// Sort imports, absolute first then relative
'import/order': [ 'warn' ]
}
};