-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
62 lines (60 loc) · 1.87 KB
/
eslint.config.js
File metadata and controls
62 lines (60 loc) · 1.87 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
import stylisticJs from '@stylistic/eslint-plugin-js';
export default [
{
plugins: {
'@stylistic/js': stylisticJs
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
// Browser globals
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
// Node.js globals
global: 'readonly',
require: 'readonly',
module: 'readonly',
process: 'readonly',
// ES2021 globals
Promise: 'readonly',
Map: 'readonly',
Set: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
BigInt: 'readonly',
console: 'readonly'
}
},
files: ['**/*.js', '**/*.cjs'],
ignores: ['node_modules/**'],
rules: {
// Custom rules from previous config
'indent': ['error', 4],
'semi': ['error', 'always'],
'no-unused-vars': 'warn',
'prefer-const': 'warn',
'no-var': 'warn',
// Common rules from standard config
'no-console': 'warn',
'no-debugger': 'warn',
'no-alert': 'warn',
'no-duplicate-imports': 'error',
'no-template-curly-in-string': 'error',
'block-scoped-var': 'error',
'curly': ['error', 'all'],
'eqeqeq': ['error', 'always'],
'no-use-before-define': 'error',
'camelcase': 'error',
'comma-dangle': ['error', 'never'],
'@stylistic/js/indent': ['error', 4]
}
},
{
files: ['.eslintrc.{js,cjs}'],
languageOptions: {
sourceType: 'script'
}
}
];