@@ -6,14 +6,28 @@ ignorePatterns:
6
6
- /web_src/fomantic
7
7
- /public/assets/js
8
8
9
+ parser : " @typescript-eslint/parser"
10
+
9
11
parserOptions :
10
12
sourceType : module
11
13
ecmaVersion : latest
14
+ project : true
15
+ extraFileExtensions : [".vue"]
16
+ parser : " @typescript-eslint/parser" # for vue plugin - https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
17
+
18
+ settings :
19
+ import/extensions : [".js", ".ts"]
20
+ import/parsers :
21
+ " @typescript-eslint/parser " : [".js", ".ts"]
22
+ import/resolver :
23
+ typescript : true
12
24
13
25
plugins :
14
26
- " @eslint-community/eslint-plugin-eslint-comments"
15
27
- " @stylistic/eslint-plugin-js"
28
+ - " @typescript-eslint/eslint-plugin"
16
29
- eslint-plugin-array-func
30
+ - eslint-plugin-deprecation
17
31
- eslint-plugin-github
18
32
- eslint-plugin-i
19
33
- eslint-plugin-no-jquery
@@ -46,7 +60,15 @@ overrides:
46
60
- files : ["*.config.*"]
47
61
rules :
48
62
i/no-unused-modules : [0]
49
- - files : ["**/*.test.*", "web_src/js/test/setup.js"]
63
+ - files : ["**/*.d.ts"]
64
+ rules :
65
+ i/no-unused-modules : [0]
66
+ " @typescript-eslint/consistent-type-definitions " : [0]
67
+ " @typescript-eslint/consistent-type-imports " : [0]
68
+ - files : ["web_src/js/types.ts"]
69
+ rules :
70
+ i/no-unused-modules : [0]
71
+ - files : ["**/*.test.*", "web_src/js/test/setup.ts"]
50
72
env :
51
73
vitest-globals/env : true
52
74
rules :
@@ -99,9 +121,25 @@ overrides:
99
121
vitest/valid-describe-callback : [2]
100
122
vitest/valid-expect : [2]
101
123
vitest/valid-title : [2]
102
- - files : ["web_src/js/modules/fetch.js ", "web_src/js/standalone/**/*"]
124
+ - files : ["web_src/js/modules/fetch.ts ", "web_src/js/standalone/**/*"]
103
125
rules :
104
126
no-restricted-syntax : [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
127
+ - files : ["**/*.vue"]
128
+ plugins :
129
+ - eslint-plugin-vue
130
+ - eslint-plugin-vue-scoped-css
131
+ extends :
132
+ - plugin:vue/vue3-recommended
133
+ - plugin:vue-scoped-css/vue3-recommended
134
+ rules :
135
+ vue/attributes-order : [0]
136
+ vue/html-closing-bracket-spacing : [2, {startTag: never, endTag: never, selfClosingTag: never}]
137
+ vue/max-attributes-per-line : [0]
138
+ vue/singleline-html-element-content-newline : [0]
139
+ - files : ["tests/e2e/**"]
140
+ plugins :
141
+ - eslint-plugin-playwright
142
+ extends : plugin:playwright/recommended
105
143
106
144
rules :
107
145
" @eslint-community/eslint-comments/disable-enable-pair " : [2]
@@ -181,6 +219,125 @@ rules:
181
219
" @stylistic/js/wrap-iife " : [2, inside]
182
220
" @stylistic/js/wrap-regex " : [0]
183
221
" @stylistic/js/yield-star-spacing " : [2, after]
222
+ " @typescript-eslint/adjacent-overload-signatures " : [0]
223
+ " @typescript-eslint/array-type " : [0]
224
+ " @typescript-eslint/await-thenable " : [2]
225
+ " @typescript-eslint/ban-ts-comment " : [2, {'ts-expect-error': false, 'ts-ignore': true, 'ts-nocheck': false, 'ts-check': false}]
226
+ " @typescript-eslint/ban-tslint-comment " : [0]
227
+ " @typescript-eslint/class-literal-property-style " : [0]
228
+ " @typescript-eslint/class-methods-use-this " : [0]
229
+ " @typescript-eslint/consistent-generic-constructors " : [0]
230
+ " @typescript-eslint/consistent-indexed-object-style " : [0]
231
+ " @typescript-eslint/consistent-return " : [0]
232
+ " @typescript-eslint/consistent-type-assertions " : [2, {assertionStyle: as, objectLiteralTypeAssertions: allow}]
233
+ " @typescript-eslint/consistent-type-definitions " : [2, type]
234
+ " @typescript-eslint/consistent-type-exports " : [2, {fixMixedExportsWithInlineTypeSpecifier: false}]
235
+ " @typescript-eslint/consistent-type-imports " : [2, {prefer: type-imports, fixStyle: separate-type-imports, disallowTypeAnnotations: true}]
236
+ " @typescript-eslint/default-param-last " : [0]
237
+ " @typescript-eslint/dot-notation " : [0]
238
+ " @typescript-eslint/explicit-function-return-type " : [0]
239
+ " @typescript-eslint/explicit-member-accessibility " : [0]
240
+ " @typescript-eslint/explicit-module-boundary-types " : [0]
241
+ " @typescript-eslint/init-declarations " : [0]
242
+ " @typescript-eslint/max-params " : [0]
243
+ " @typescript-eslint/member-ordering " : [0]
244
+ " @typescript-eslint/method-signature-style " : [0]
245
+ " @typescript-eslint/naming-convention " : [0]
246
+ " @typescript-eslint/no-array-constructor " : [2]
247
+ " @typescript-eslint/no-array-delete " : [2]
248
+ " @typescript-eslint/no-base-to-string " : [0]
249
+ " @typescript-eslint/no-confusing-non-null-assertion " : [2]
250
+ " @typescript-eslint/no-confusing-void-expression " : [0]
251
+ " @typescript-eslint/no-dupe-class-members " : [0]
252
+ " @typescript-eslint/no-duplicate-enum-values " : [2]
253
+ " @typescript-eslint/no-duplicate-type-constituents " : [2, {ignoreUnions: true}]
254
+ " @typescript-eslint/no-dynamic-delete " : [0]
255
+ " @typescript-eslint/no-empty-function " : [0]
256
+ " @typescript-eslint/no-empty-interface " : [0]
257
+ " @typescript-eslint/no-empty-object-type " : [2]
258
+ " @typescript-eslint/no-explicit-any " : [0]
259
+ " @typescript-eslint/no-extra-non-null-assertion " : [2]
260
+ " @typescript-eslint/no-extraneous-class " : [0]
261
+ " @typescript-eslint/no-floating-promises " : [0]
262
+ " @typescript-eslint/no-for-in-array " : [2]
263
+ " @typescript-eslint/no-implied-eval " : [2]
264
+ " @typescript-eslint/no-import-type-side-effects " : [0] # dupe with consistent-type-imports
265
+ " @typescript-eslint/no-inferrable-types " : [0]
266
+ " @typescript-eslint/no-invalid-this " : [0]
267
+ " @typescript-eslint/no-invalid-void-type " : [0]
268
+ " @typescript-eslint/no-loop-func " : [0]
269
+ " @typescript-eslint/no-loss-of-precision " : [0]
270
+ " @typescript-eslint/no-magic-numbers " : [0]
271
+ " @typescript-eslint/no-meaningless-void-operator " : [0]
272
+ " @typescript-eslint/no-misused-new " : [2]
273
+ " @typescript-eslint/no-misused-promises " : [2, {checksVoidReturn: {attributes: false, arguments: false}}]
274
+ " @typescript-eslint/no-mixed-enums " : [0]
275
+ " @typescript-eslint/no-namespace " : [2]
276
+ " @typescript-eslint/no-non-null-asserted-nullish-coalescing " : [0]
277
+ " @typescript-eslint/no-non-null-asserted-optional-chain " : [2]
278
+ " @typescript-eslint/no-non-null-assertion " : [0]
279
+ " @typescript-eslint/no-redeclare " : [0]
280
+ " @typescript-eslint/no-redundant-type-constituents " : [2]
281
+ " @typescript-eslint/no-require-imports " : [2]
282
+ " @typescript-eslint/no-restricted-imports " : [0]
283
+ " @typescript-eslint/no-restricted-types " : [0]
284
+ " @typescript-eslint/no-shadow " : [0]
285
+ " @typescript-eslint/no-this-alias " : [0] # handled by unicorn/no-this-assignment
286
+ " @typescript-eslint/no-unnecessary-boolean-literal-compare " : [0]
287
+ " @typescript-eslint/no-unnecessary-condition " : [0]
288
+ " @typescript-eslint/no-unnecessary-qualifier " : [0]
289
+ " @typescript-eslint/no-unnecessary-template-expression " : [0]
290
+ " @typescript-eslint/no-unnecessary-type-arguments " : [0]
291
+ " @typescript-eslint/no-unnecessary-type-assertion " : [2]
292
+ " @typescript-eslint/no-unnecessary-type-constraint " : [2]
293
+ " @typescript-eslint/no-unsafe-argument " : [0]
294
+ " @typescript-eslint/no-unsafe-assignment " : [0]
295
+ " @typescript-eslint/no-unsafe-call " : [0]
296
+ " @typescript-eslint/no-unsafe-declaration-merging " : [2]
297
+ " @typescript-eslint/no-unsafe-enum-comparison " : [2]
298
+ " @typescript-eslint/no-unsafe-function-type " : [2]
299
+ " @typescript-eslint/no-unsafe-member-access " : [0]
300
+ " @typescript-eslint/no-unsafe-return " : [0]
301
+ " @typescript-eslint/no-unsafe-unary-minus " : [2]
302
+ " @typescript-eslint/no-unused-expressions " : [0]
303
+ " @typescript-eslint/no-unused-vars " : [2, {vars: all, args: all, caughtErrors: all, ignoreRestSiblings: false, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, destructuredArrayIgnorePattern: ^_}]
304
+ " @typescript-eslint/no-use-before-define " : [0]
305
+ " @typescript-eslint/no-useless-constructor " : [0]
306
+ " @typescript-eslint/no-useless-empty-export " : [0]
307
+ " @typescript-eslint/no-wrapper-object-types " : [2]
308
+ " @typescript-eslint/non-nullable-type-assertion-style " : [0]
309
+ " @typescript-eslint/only-throw-error " : [2]
310
+ " @typescript-eslint/parameter-properties " : [0]
311
+ " @typescript-eslint/prefer-as-const " : [2]
312
+ " @typescript-eslint/prefer-destructuring " : [0]
313
+ " @typescript-eslint/prefer-enum-initializers " : [0]
314
+ " @typescript-eslint/prefer-find " : [2]
315
+ " @typescript-eslint/prefer-for-of " : [2]
316
+ " @typescript-eslint/prefer-function-type " : [2]
317
+ " @typescript-eslint/prefer-includes " : [2]
318
+ " @typescript-eslint/prefer-literal-enum-member " : [0]
319
+ " @typescript-eslint/prefer-namespace-keyword " : [0]
320
+ " @typescript-eslint/prefer-nullish-coalescing " : [0]
321
+ " @typescript-eslint/prefer-optional-chain " : [2, {requireNullish: true}]
322
+ " @typescript-eslint/prefer-promise-reject-errors " : [0]
323
+ " @typescript-eslint/prefer-readonly " : [0]
324
+ " @typescript-eslint/prefer-readonly-parameter-types " : [0]
325
+ " @typescript-eslint/prefer-reduce-type-parameter " : [0]
326
+ " @typescript-eslint/prefer-regexp-exec " : [0]
327
+ " @typescript-eslint/prefer-return-this-type " : [0]
328
+ " @typescript-eslint/prefer-string-starts-ends-with " : [2, {allowSingleElementEquality: always}]
329
+ " @typescript-eslint/promise-function-async " : [0]
330
+ " @typescript-eslint/require-array-sort-compare " : [0]
331
+ " @typescript-eslint/require-await " : [0]
332
+ " @typescript-eslint/restrict-plus-operands " : [2]
333
+ " @typescript-eslint/restrict-template-expressions " : [0]
334
+ " @typescript-eslint/return-await " : [0]
335
+ " @typescript-eslint/strict-boolean-expressions " : [0]
336
+ " @typescript-eslint/switch-exhaustiveness-check " : [0]
337
+ " @typescript-eslint/triple-slash-reference " : [2]
338
+ " @typescript-eslint/typedef " : [0]
339
+ " @typescript-eslint/unbound-method " : [0] # too many false-positives
340
+ " @typescript-eslint/unified-signatures " : [2]
184
341
accessor-pairs : [2]
185
342
array-callback-return : [2, {checkForEach: true}]
186
343
array-func/avoid-reverse : [2]
@@ -202,6 +359,7 @@ rules:
202
359
default-case-last : [2]
203
360
default-case : [0]
204
361
default-param-last : [0]
362
+ deprecation/deprecation : [2]
205
363
dot-notation : [0]
206
364
eqeqeq : [2]
207
365
for-direction : [2]
@@ -263,7 +421,7 @@ rules:
263
421
i/no-internal-modules : [0]
264
422
i/no-mutable-exports : [0]
265
423
i/no-named-as-default-member : [0]
266
- i/no-named-as-default : [2 ]
424
+ i/no-named-as-default : [0 ]
267
425
i/no-named-default : [0]
268
426
i/no-named-export : [0]
269
427
i/no-namespace : [0]
@@ -273,7 +431,7 @@ rules:
273
431
i/no-restricted-paths : [0]
274
432
i/no-self-import : [2]
275
433
i/no-unassigned-import : [0]
276
- i/no-unresolved : [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/ ]}]
434
+ i/no-unresolved : [2, {commonjs: true, ignore: ["\\?.+$"]}]
277
435
i/no-unused-modules : [2, {unusedExports: true}]
278
436
i/no-useless-path-segments : [2, {commonjs: true}]
279
437
i/no-webpack-loader-syntax : [2]
@@ -293,7 +451,7 @@ rules:
293
451
multiline-comment-style : [2, separate-lines]
294
452
new-cap : [0]
295
453
no-alert : [0]
296
- no-array-constructor : [2]
454
+ no-array-constructor : [0] # handled by @typescript-eslint/no-array-constructor
297
455
no-async-promise-executor : [0]
298
456
no-await-in-loop : [0]
299
457
no-bitwise : [0]
@@ -318,7 +476,7 @@ rules:
318
476
no-dupe-else-if : [2]
319
477
no-dupe-keys : [2]
320
478
no-duplicate-case : [2]
321
- no-duplicate-imports : [2 ]
479
+ no-duplicate-imports : [0 ]
322
480
no-else-return : [2]
323
481
no-empty-character-class : [2]
324
482
no-empty-function : [0]
@@ -337,7 +495,7 @@ rules:
337
495
no-global-assign : [2]
338
496
no-implicit-coercion : [2]
339
497
no-implicit-globals : [0]
340
- no-implied-eval : [2]
498
+ no-implied-eval : [0] # handled by @typescript-eslint/no-implied-eval
341
499
no-import-assign : [2]
342
500
no-inline-comments : [0]
343
501
no-inner-declarations : [2]
@@ -356,7 +514,7 @@ rules:
356
514
no-jquery/no-box-model : [2]
357
515
no-jquery/no-browser : [2]
358
516
no-jquery/no-camel-case : [2]
359
- no-jquery/no-class-state : [0 ]
517
+ no-jquery/no-class-state : [2 ]
360
518
no-jquery/no-class : [0]
361
519
no-jquery/no-clone : [2]
362
520
no-jquery/no-closest : [0]
@@ -412,7 +570,7 @@ rules:
412
570
no-jquery/no-param : [2]
413
571
no-jquery/no-parent : [0]
414
572
no-jquery/no-parents : [2]
415
- no-jquery/no-parse-html-literal : [0 ]
573
+ no-jquery/no-parse-html-literal : [2 ]
416
574
no-jquery/no-parse-html : [2]
417
575
no-jquery/no-parse-json : [2]
418
576
no-jquery/no-parse-xml : [2]
@@ -465,12 +623,12 @@ rules:
465
623
no-promise-executor-return : [0]
466
624
no-proto : [2]
467
625
no-prototype-builtins : [2]
468
- no-redeclare : [2]
626
+ no-redeclare : [0] # must be disabled for typescript overloads
469
627
no-regex-spaces : [2]
470
628
no-restricted-exports : [0]
471
629
no-restricted-globals : [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top, __dirname, __filename]
472
630
no-restricted-imports : [0]
473
- no-restricted-syntax : [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.js instead"}]
631
+ no-restricted-syntax : [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.ts instead"}]
474
632
no-return-assign : [0]
475
633
no-script-url : [2]
476
634
no-self-assign : [2, {props: true}]
@@ -498,7 +656,7 @@ rules:
498
656
no-unused-expressions : [2]
499
657
no-unused-labels : [2]
500
658
no-unused-private-class-members : [2]
501
- no-unused-vars : [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, destructuredArrayIgnorePattern: ^_, ignoreRestSiblings: false}]
659
+ no-unused-vars : [0] # handled by @typescript-eslint/no-unused-vars
502
660
no-use-before-define : [2, {functions: false, classes: true, variables: true, allowNamedExports: true}]
503
661
no-use-extend-native/no-use-extend-native : [2]
504
662
no-useless-backreference : [2]
@@ -613,7 +771,7 @@ rules:
613
771
regexp/unicode-escape : [0]
614
772
regexp/use-ignore-case : [0]
615
773
require-atomic-updates : [0]
616
- require-await : [0]
774
+ require-await : [0] # handled by @typescript-eslint/require-await
617
775
require-unicode-regexp : [0]
618
776
require-yield : [2]
619
777
sonarjs/cognitive-complexity : [0]
@@ -687,6 +845,7 @@ rules:
687
845
unicorn/no-invalid-fetch-options : [2]
688
846
unicorn/no-invalid-remove-event-listener : [2]
689
847
unicorn/no-keyword-prefix : [0]
848
+ unicorn/no-length-as-slice-end : [2]
690
849
unicorn/no-lonely-if : [2]
691
850
unicorn/no-magic-array-flat-depth : [0]
692
851
unicorn/no-negated-condition : [0]
0 commit comments