-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
53 lines (49 loc) · 1.53 KB
/
eslint.config.js
File metadata and controls
53 lines (49 loc) · 1.53 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
import js from '@eslint/js';
import globals from 'globals';
export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals.es2022,
},
},
rules: {
// Errors
'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-undef': 'error',
'no-duplicate-imports': 'error',
// Best practices
'eqeqeq': ['error', 'always'],
'no-var': 'error',
'prefer-const': 'error',
'prefer-arrow-callback': 'error',
'no-return-await': 'error',
'no-throw-literal': 'error',
'no-promise-executor-return': 'error',
// Node.js specific
'no-process-exit': 'off', // We intentionally call process.exit in startup/shutdown
'handle-callback-err': 'error',
// Style (non-blocking — warnings only)
'prefer-template': 'warn',
'object-shorthand': 'warn',
},
ignores: ['node_modules/**', 'coverage/**', 'dist/**'],
},
{
// Relax rules for test files
files: ['tests/**/*.js'],
languageOptions: {
globals: {
...globals.jest,
},
},
rules: {
'no-unused-vars': 'warn',
},
},
];