-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
55 lines (52 loc) · 1.62 KB
/
eslint.config.js
File metadata and controls
55 lines (52 loc) · 1.62 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
44
45
46
47
48
49
50
51
52
53
54
55
import js from '@eslint/js';
import globals from 'globals';
export default [
{
ignores: ['node_modules/', 'template/', 'example/', 'results/']
},
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node
}
},
rules: {
// correctness
'no-unused-vars': ['error', { argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
'no-undef': 'error',
'no-constant-condition': 'error',
'no-duplicate-case': 'error',
'no-unreachable': 'error',
'valid-typeof': 'error',
'eqeqeq': ['error', 'always'],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-new-func': 'error',
'no-extend-native': 'error',
// style
'semi': ['error', 'always'],
'quotes': ['error', 'single', { avoidEscape: true }],
'indent': ['error', 4],
'no-trailing-spaces': 'error',
'eol-last': 'error',
'no-multiple-empty-lines': ['error', { max: 2 }],
'comma-dangle': ['error', 'never'],
'camelcase': ['error', { properties: 'never' }],
// best practice
'no-console': 'warn',
'no-debugger': 'error',
'curly': ['error', 'all'],
'no-throw-literal': 'error',
'prefer-const': 'error'
}
},
{
files: ['test/**/*.js'],
rules: {
'no-unused-vars': 'off'
}
}
];