-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
43 lines (42 loc) · 1.12 KB
/
eslint.config.js
File metadata and controls
43 lines (42 loc) · 1.12 KB
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
const globals = require('globals')
const js = require('@eslint/js')
module.exports = [
{
files: ['index.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
globals: {
...globals.es2022,
...globals.node
}
},
rules: {
...js.configs.recommended.rules,
// --- code quality ---
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-useless-escape': 'off',
'no-var': 'error',
'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
'eqeqeq': 'error',
'curly': ['error', 'multi-line'],
// --- formatting ---
'space-before-function-paren': ['error', { anonymous: 'never', named: 'never', asyncArrow: 'never' }],
'no-extra-semi': 'off',
'object-curly-spacing': ['error', 'always'],
'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
'block-spacing': 'error'
}
},
{
files: ['test/**/*.js'],
languageOptions: {
globals: {
...globals.mocha,
expect: 'readonly',
assert: 'readonly',
should: 'readonly'
}
}
}
]