-
Notifications
You must be signed in to change notification settings - Fork 352
/
.eslintrc.js
80 lines (77 loc) · 1.66 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* eslint-env node */
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: ['import'],
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
globals: {
global: true
},
env: {
browser: true,
es6: true
},
rules: {
'no-console': 'off',
'prefer-const': 'error',
'getter-return': 'error',
'padding-line-between-statements': [
'error',
// require blank lines before all return statements,
{ blankLine: 'always', prev: '*', next: 'return' },
// Require blank lines after every sequence of variable declarations
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var']
}
],
'no-restricted-properties': [
2,
{
object: 'Object',
property: 'assign',
message: 'Please use the spread operator instead.'
}
],
// Require that imports occur at the top of the file
'import/first': 'error',
// Require imports to be grouped and ordered consistently
'import/order': [
'error',
{
'newlines-between': 'always'
}
]
},
overrides: [
// test files
{
files: ['tests/**/*.js', '**/*/tests/**/*.js'],
env: {
mocha: true
},
globals: {
chai: true,
expect: true
}
},
{
files: ['**/*/tests/node/**/*.js'],
env: {
browser: false
}
},
{
files: ['**/*/tests/jest/**/*.js'],
env: {
jest: true,
mocha: false
}
}
]
};