-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy patheslint.config.js
More file actions
45 lines (41 loc) · 1.3 KB
/
eslint.config.js
File metadata and controls
45 lines (41 loc) · 1.3 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
import js from '@eslint/js';
import globals from 'globals';
export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.commonjs,
...globals.es2021,
...globals.jest,
...globals.node,
md5: 'readonly'
}
},
rules: {
// Error prevention
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-undef': 'error',
'no-console': ['warn', { allow: ['error', 'warn'] }],
// Code style
'indent': ['error', 4, { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
'quotes': ['error', 'single', { avoidEscape: true }],
'semi': ['error', 'always'],
// Best practices
'eqeqeq': ['error', 'always'],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-new-func': 'error',
'no-return-assign': 'error',
'no-throw-literal': 'error',
'prefer-const': 'error',
'no-var': 'error',
// Security
'no-script-url': 'error'
}
}
];