@@ -2,6 +2,7 @@ import { includeIgnoreFile } from '@eslint/compat';
2
2
import eslint from '@eslint/js' ;
3
3
import stylistic from '@stylistic/eslint-plugin' ;
4
4
import eslintPluginVitest from '@vitest/eslint-plugin' ;
5
+ import eslintPluginFileProgress from 'eslint-plugin-file-progress' ;
5
6
import eslintPluginJsdoc from 'eslint-plugin-jsdoc' ;
6
7
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' ;
7
8
import eslintPluginUnicorn from 'eslint-plugin-unicorn' ;
@@ -17,6 +18,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
17
18
//#region global
18
19
includeIgnoreFile ( gitignorePath ) ,
19
20
{
21
+ name : 'manual ignores' ,
20
22
ignores : [
21
23
// Skip some files that don't need linting right now
22
24
'.github/workflows/commentCodeGeneration.ts' ,
@@ -28,6 +30,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
28
30
] ,
29
31
} ,
30
32
{
33
+ name : 'linter options' ,
31
34
linterOptions : {
32
35
reportUnusedDisableDirectives : 'error' ,
33
36
} ,
@@ -37,6 +40,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
37
40
//#region eslint (js)
38
41
eslint . configs . recommended ,
39
42
{
43
+ name : 'eslint overrides' ,
40
44
rules : {
41
45
eqeqeq : [ 'error' , 'always' , { null : 'ignore' } ] ,
42
46
'logical-assignment-operators' : 'error' ,
@@ -51,9 +55,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
51
55
//#region typescript-eslint
52
56
...tseslint . configs . strictTypeChecked ,
53
57
{
54
- plugins : {
55
- '@typescript-eslint' : tseslint . plugin ,
56
- } ,
58
+ name : 'typescript-eslint overrides' ,
57
59
languageOptions : {
58
60
parserOptions : {
59
61
project : true ,
@@ -128,6 +130,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
128
130
129
131
//#region stylistic
130
132
{
133
+ name : 'stylistic overrides' ,
131
134
plugins : {
132
135
'@stylistic' : stylistic ,
133
136
} ,
@@ -143,6 +146,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
143
146
//#region unicorn
144
147
eslintPluginUnicorn . configs [ 'flat/recommended' ] ,
145
148
{
149
+ name : 'unicorn overrides' ,
146
150
rules : {
147
151
'unicorn/import-style' : 'off' , // subjective & doesn't do anything for us
148
152
'unicorn/no-array-callback-reference' : 'off' , // reduces readability
@@ -153,13 +157,13 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
153
157
'unicorn/number-literal-case' : 'off' , // incompatible with prettier
154
158
'unicorn/numeric-separators-style' : 'off' , // "magic numbers" may carry specific meaning
155
159
'unicorn/prefer-string-raw' : 'off' , // The additional prefix doesn't help readability
160
+ 'unicorn/prefer-string-slice' : 'off' , // string.substring is sometimes easier to use
156
161
'unicorn/prefer-ternary' : 'off' , // ternaries aren't always better
157
162
158
163
// TODO @Shinigami 92 2023-09-23: The following rules currently conflict with our code.
159
164
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
160
165
'unicorn/consistent-function-scoping' : 'off' ,
161
166
'unicorn/prefer-export-from' : 'off' ,
162
- 'unicorn/prefer-string-slice' : 'off' ,
163
167
'unicorn/prevent-abbreviations' : 'off' ,
164
168
} ,
165
169
} ,
@@ -168,6 +172,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
168
172
//#region jsdoc
169
173
eslintPluginJsdoc . configs [ 'flat/recommended-typescript-error' ] ,
170
174
{
175
+ name : 'jsdoc overrides' ,
171
176
rules : {
172
177
'jsdoc/require-jsdoc' : 'off' , // Enabled only for src/**/*.ts
173
178
'jsdoc/require-returns' : 'off' ,
@@ -200,10 +205,15 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
200
205
201
206
//#region prettier
202
207
eslintPluginPrettierRecommended ,
203
- //#endregion,
208
+ //#endregion
209
+
210
+ //#region file-progress
211
+ eslintPluginFileProgress . configs . recommended ,
212
+ //#endregion
204
213
205
214
//#region overrides
206
215
{
216
+ name : 'src/**/*.ts overrides' ,
207
217
files : [ 'src/**/*.ts' ] ,
208
218
rules : {
209
219
'no-undef' : 'error' , // Must override the config from typescript-eslint
@@ -215,12 +225,14 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
215
225
} ,
216
226
} ,
217
227
{
228
+ name : 'src/locale/**/*.ts overrides' ,
218
229
files : [ 'src/locale/**/*.ts' ] ,
219
230
rules : {
220
231
'unicorn/filename-case' : 'off' , // our locale files have a custom naming scheme
221
232
} ,
222
233
} ,
223
234
{
235
+ name : 'src/{definitions,locales}/**/*.ts overrides' ,
224
236
files : [ 'src/definitions/**/*.ts' , 'src/locales/**/*.ts' ] ,
225
237
rules : {
226
238
'unicorn/filename-case' : [
@@ -233,6 +245,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
233
245
} ,
234
246
} ,
235
247
{
248
+ name : 'test/**/*.ts overrides' ,
236
249
files : [ 'test/**/*.spec.ts' , 'test/**/*.spec.d.ts' ] ,
237
250
plugins : {
238
251
vitest : eslintPluginVitest ,
0 commit comments