-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
70 lines (70 loc) · 1.42 KB
/
eslint.config.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
import globals from 'globals'
import pluginJs from '@eslint/js'
export default [
{
files: ['*.js'],
languageOptions: {
globals: {
...globals.node
}
}
},
{
files: ['**/*.js','**/*.mjs'],
ignores: [
'dist/**/*.js',
'dist/**/*.mjs',
'./coverage/**/*.js',
'src/legacyPolyfills.js'],
rules: {
...pluginJs.configs.recommended.rules,
semi: [2, 'never'],
quotes: [2, 'single'],
'object-curly-spacing': [2, 'always'],
'no-unused-vars': [2, { 'vars': 'all', 'args': 'after-used', 'ignoreRestSiblings': true }],
indent: ['warn', 'tab', {
ignoredNodes: [
'ConditionalExpression',
'TemplateLiteral'
],
SwitchCase: 1,
MemberExpression: 1,
// FunctionDeclaration: { body: 1, parameters: 1 },
FunctionExpression: { body: 1, parameters: 1 },
CallExpression: { arguments: 1 },
}],
'no-multi-spaces': 'error',
'no-new-wrappers': 2,
'no-new-func': 2,
'no-loop-func': 2,
'dot-location': ['error', 'property']
},
},
{
files: ['src/*.js','src/*.mjs'],
languageOptions: {
globals: {
...globals.browser
}
}
},
{
files: ['jest.setup.js', '__tests__/**/*.js'],
rules: {
},
languageOptions: {
globals: {
...globals.jest,
...globals.browser,
...globals.node,
utils: false,
page: false,
browser: false,
__BROWSER__: false,
__SERVERURL__: false,
__SERVERPORT__: false,
__HTML__: false
}
}
}
]