-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
125 lines (114 loc) · 3.93 KB
/
eslint.config.js
File metadata and controls
125 lines (114 loc) · 3.93 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Path: eslint.config.js
import js from '@eslint/js';
import globals from 'globals';
/**
* ESLint Flat Configuration for EBGeo Street View Service
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new
*/
export default [
// Base recommended rules
js.configs.recommended,
// Global configuration
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals.es2021,
}
},
rules: {
// ===== ERROR PREVENTION =====
'no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}],
'no-undef': 'error',
'no-redeclare': 'error',
'no-duplicate-case': 'error',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-extra-boolean-cast': 'error',
'no-irregular-whitespace': 'error',
'no-loss-of-precision': 'error',
'no-misleading-character-class': 'error',
'no-prototype-builtins': 'warn',
'no-template-curly-in-string': 'warn',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-optional-chaining': 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
// ===== BEST PRACTICES =====
'eqeqeq': ['error', 'always', { null: 'ignore' }],
'no-caller': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-implied-eval': 'error',
'no-iterator': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-multi-str': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-return-assign': ['error', 'except-parens'],
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unmodified-loop-condition': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-useless-escape': 'warn',
'no-useless-return': 'warn',
'no-void': 'error',
'no-with': 'error',
'prefer-promise-reject-errors': 'warn',
'radix': 'error',
// ===== ES6+ =====
'no-var': 'error',
'prefer-const': ['warn', { destructuring: 'all' }],
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'no-useless-computed-key': 'warn',
'no-useless-constructor': 'warn',
'no-useless-rename': 'warn',
'no-duplicate-imports': 'error',
'symbol-description': 'warn',
// ===== CODE STYLE (minimal, non-controversial) =====
'no-multiple-empty-lines': ['warn', { max: 2, maxEOF: 1 }],
'no-trailing-spaces': 'warn',
'eol-last': ['warn', 'always'],
'no-tabs': 'error',
'curly': ['error', 'multi-line', 'consistent'],
'brace-style': ['warn', '1tbs', { allowSingleLine: true }],
// ===== CONSOLE (allowed — server-side logging) =====
'no-console': 'off',
// ===== COMMENTS =====
'spaced-comment': ['warn', 'always', {
line: { markers: ['/'] },
block: { balanced: true }
}]
}
},
// Config files
{
files: ['*.config.js'],
languageOptions: {
globals: {
...globals.node
}
}
},
// Ignore patterns
{
ignores: [
'node_modules/**',
'data/**',
'public/**',
'*.min.js',
]
}
];