-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy patheslint.config.mjs
More file actions
99 lines (96 loc) · 3.49 KB
/
eslint.config.mjs
File metadata and controls
99 lines (96 loc) · 3.49 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
export default [
{ ignores: ['node_modules/**', 'dist/**', 'coverage/**', 'temp/**'] },
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
process: 'readonly',
console: 'readonly',
Buffer: 'readonly',
setTimeout: 'readonly',
setInterval: 'readonly',
clearTimeout: 'readonly',
clearInterval: 'readonly',
global: 'writable',
__dirname: 'readonly',
__filename: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
fetch: 'readonly',
structuredClone: 'readonly',
}
},
rules: {
// ── Unused vars ───────────────────────────────────────────────
'no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '.*'
}],
// ── Real bug catchers ─────────────────────────────────────────
'no-constant-condition': 'error',
'no-duplicate-case': 'error',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-unreachable': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-undef': 'error',
'eqeqeq': ['error', 'always', { null: 'ignore' }],
'no-var': 'error',
'prefer-const': 'error',
'no-throw-literal': 'error',
'no-return-assign': 'error',
'no-eval': 'error',
'no-new-func': 'error',
'no-implied-eval': 'error',
'no-extend-native': 'error',
'no-sequences': 'error',
'radix': 'error',
'no-mixed-spaces-and-tabs': 'error',
// ── Code quality ──────────────────────────────────────────────
'no-console': 'off',
'no-debugger': 'error',
'no-alert': 'error',
'no-with': 'error',
'no-caller': 'error',
'no-extra-bind': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-useless-escape': 'error',
'no-useless-return': 'error',
'no-lone-blocks': 'error',
'no-multi-spaces': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-unexpected-multiline': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
'array-callback-return': 'error',
'consistent-return': 'off',
'default-case': 'off',
'dot-notation': 'error',
'guard-for-in': 'warn',
'no-await-in-loop': 'off',
'no-promise-executor-return': 'off',
'no-constructor-return': 'error',
'require-atomic-updates': 'off',
// ── ES6+ ──────────────────────────────────────────────────────
'arrow-body-style': 'off',
'no-duplicate-imports': 'error',
'object-shorthand': ['warn', 'always'],
'prefer-arrow-callback': 'warn',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'warn',
'symbol-description': 'error',
}
}
];