@@ -6,14 +6,28 @@ ignorePatterns:
66 - /web_src/fomantic
77 - /public/assets/js
88
9+ parser : " @typescript-eslint/parser"
10+
911parserOptions :
1012 sourceType : module
1113 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
1224
1325plugins :
1426 - " @eslint-community/eslint-plugin-eslint-comments"
1527 - " @stylistic/eslint-plugin-js"
28+ - " @typescript-eslint/eslint-plugin"
1629 - eslint-plugin-array-func
30+ - eslint-plugin-deprecation
1731 - eslint-plugin-github
1832 - eslint-plugin-i
1933 - eslint-plugin-no-jquery
@@ -33,7 +47,6 @@ overrides:
3347 - files : ["web_src/**/*"]
3448 globals :
3549 __webpack_public_path__ : true
36- htmx : true
3750 process : false # https://github.com/webpack/webpack/issues/15833
3851 - files : ["web_src/**/*", "docs/**/*"]
3952 env :
@@ -47,7 +60,15 @@ overrides:
4760 - files : ["*.config.*"]
4861 rules :
4962 i/no-unused-modules : [0]
50- - 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"]
5172 env :
5273 vitest-globals/env : true
5374 rules :
@@ -100,9 +121,25 @@ overrides:
100121 vitest/valid-describe-callback : [2]
101122 vitest/valid-expect : [2]
102123 vitest/valid-title : [2]
103- - files : ["web_src/js/modules/fetch.js ", "web_src/js/standalone/**/*"]
124+ - files : ["web_src/js/modules/fetch.ts ", "web_src/js/standalone/**/*"]
104125 rules :
105126 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
106143
107144rules :
108145 " @eslint-community/eslint-comments/disable-enable-pair " : [2]
@@ -182,6 +219,123 @@ rules:
182219 " @stylistic/js/wrap-iife " : [2, inside]
183220 " @stylistic/js/wrap-regex " : [0]
184221 " @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/ban-types " : [2, {extendDefaults: true, types: {Function: false}}]
228+ " @typescript-eslint/class-literal-property-style " : [0]
229+ " @typescript-eslint/class-methods-use-this " : [0]
230+ " @typescript-eslint/consistent-generic-constructors " : [0]
231+ " @typescript-eslint/consistent-indexed-object-style " : [0]
232+ " @typescript-eslint/consistent-return " : [0]
233+ " @typescript-eslint/consistent-type-assertions " : [2, {assertionStyle: as, objectLiteralTypeAssertions: allow}]
234+ " @typescript-eslint/consistent-type-definitions " : [2, type]
235+ " @typescript-eslint/consistent-type-exports " : [2, {fixMixedExportsWithInlineTypeSpecifier: false}]
236+ " @typescript-eslint/consistent-type-imports " : [2, {prefer: type-imports, fixStyle: separate-type-imports, disallowTypeAnnotations: true}]
237+ " @typescript-eslint/default-param-last " : [0]
238+ " @typescript-eslint/dot-notation " : [0]
239+ " @typescript-eslint/explicit-function-return-type " : [0]
240+ " @typescript-eslint/explicit-member-accessibility " : [0]
241+ " @typescript-eslint/explicit-module-boundary-types " : [0]
242+ " @typescript-eslint/init-declarations " : [0]
243+ " @typescript-eslint/max-params " : [0]
244+ " @typescript-eslint/member-ordering " : [0]
245+ " @typescript-eslint/method-signature-style " : [0]
246+ " @typescript-eslint/naming-convention " : [0]
247+ " @typescript-eslint/no-array-constructor " : [2]
248+ " @typescript-eslint/no-array-delete " : [2]
249+ " @typescript-eslint/no-base-to-string " : [0]
250+ " @typescript-eslint/no-confusing-non-null-assertion " : [2]
251+ " @typescript-eslint/no-confusing-void-expression " : [0]
252+ " @typescript-eslint/no-dupe-class-members " : [0]
253+ " @typescript-eslint/no-duplicate-enum-values " : [2]
254+ " @typescript-eslint/no-duplicate-type-constituents " : [2, {ignoreUnions: true}]
255+ " @typescript-eslint/no-dynamic-delete " : [0]
256+ " @typescript-eslint/no-empty-function " : [0]
257+ " @typescript-eslint/no-empty-interface " : [0]
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 " : [2]
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 " : [0]
282+ " @typescript-eslint/no-restricted-imports " : [0]
283+ " @typescript-eslint/no-shadow " : [0]
284+ " @typescript-eslint/no-this-alias " : [0] # handled by unicorn/no-this-assignment
285+ " @typescript-eslint/no-unnecessary-boolean-literal-compare " : [0]
286+ " @typescript-eslint/no-unnecessary-condition " : [0]
287+ " @typescript-eslint/no-unnecessary-qualifier " : [0]
288+ " @typescript-eslint/no-unnecessary-template-expression " : [0]
289+ " @typescript-eslint/no-unnecessary-type-arguments " : [0]
290+ " @typescript-eslint/no-unnecessary-type-assertion " : [2]
291+ " @typescript-eslint/no-unnecessary-type-constraint " : [2]
292+ " @typescript-eslint/no-unsafe-argument " : [0]
293+ " @typescript-eslint/no-unsafe-assignment " : [0]
294+ " @typescript-eslint/no-unsafe-call " : [0]
295+ " @typescript-eslint/no-unsafe-declaration-merging " : [2]
296+ " @typescript-eslint/no-unsafe-enum-comparison " : [2]
297+ " @typescript-eslint/no-unsafe-member-access " : [0]
298+ " @typescript-eslint/no-unsafe-return " : [0]
299+ " @typescript-eslint/no-unsafe-unary-minus " : [2]
300+ " @typescript-eslint/no-unused-expressions " : [0]
301+ " @typescript-eslint/no-unused-vars " : [2, {vars: all, args: all, caughtErrors: all, ignoreRestSiblings: false, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, destructuredArrayIgnorePattern: ^_}]
302+ " @typescript-eslint/no-use-before-define " : [0]
303+ " @typescript-eslint/no-useless-constructor " : [0]
304+ " @typescript-eslint/no-useless-empty-export " : [0]
305+ " @typescript-eslint/no-var-requires " : [2]
306+ " @typescript-eslint/non-nullable-type-assertion-style " : [0]
307+ " @typescript-eslint/only-throw-error " : [2]
308+ " @typescript-eslint/parameter-properties " : [0]
309+ " @typescript-eslint/prefer-as-const " : [2]
310+ " @typescript-eslint/prefer-destructuring " : [0]
311+ " @typescript-eslint/prefer-enum-initializers " : [0]
312+ " @typescript-eslint/prefer-find " : [2]
313+ " @typescript-eslint/prefer-for-of " : [2]
314+ " @typescript-eslint/prefer-function-type " : [2]
315+ " @typescript-eslint/prefer-includes " : [2]
316+ " @typescript-eslint/prefer-literal-enum-member " : [0]
317+ " @typescript-eslint/prefer-namespace-keyword " : [0]
318+ " @typescript-eslint/prefer-nullish-coalescing " : [0]
319+ " @typescript-eslint/prefer-optional-chain " : [2, {requireNullish: true}]
320+ " @typescript-eslint/prefer-promise-reject-errors " : [0]
321+ " @typescript-eslint/prefer-readonly " : [0]
322+ " @typescript-eslint/prefer-readonly-parameter-types " : [0]
323+ " @typescript-eslint/prefer-reduce-type-parameter " : [0]
324+ " @typescript-eslint/prefer-regexp-exec " : [0]
325+ " @typescript-eslint/prefer-return-this-type " : [0]
326+ " @typescript-eslint/prefer-string-starts-ends-with " : [2, {allowSingleElementEquality: always}]
327+ " @typescript-eslint/promise-function-async " : [0]
328+ " @typescript-eslint/require-array-sort-compare " : [0]
329+ " @typescript-eslint/require-await " : [0]
330+ " @typescript-eslint/restrict-plus-operands " : [2]
331+ " @typescript-eslint/restrict-template-expressions " : [0]
332+ " @typescript-eslint/return-await " : [0]
333+ " @typescript-eslint/strict-boolean-expressions " : [0]
334+ " @typescript-eslint/switch-exhaustiveness-check " : [0]
335+ " @typescript-eslint/triple-slash-reference " : [2]
336+ " @typescript-eslint/typedef " : [0]
337+ " @typescript-eslint/unbound-method " : [2]
338+ " @typescript-eslint/unified-signatures " : [2]
185339 accessor-pairs : [2]
186340 array-callback-return : [2, {checkForEach: true}]
187341 array-func/avoid-reverse : [2]
@@ -203,6 +357,7 @@ rules:
203357 default-case-last : [2]
204358 default-case : [0]
205359 default-param-last : [0]
360+ deprecation/deprecation : [2]
206361 dot-notation : [0]
207362 eqeqeq : [2]
208363 for-direction : [2]
@@ -264,7 +419,7 @@ rules:
264419 i/no-internal-modules : [0]
265420 i/no-mutable-exports : [0]
266421 i/no-named-as-default-member : [0]
267- i/no-named-as-default : [2 ]
422+ i/no-named-as-default : [0 ]
268423 i/no-named-default : [0]
269424 i/no-named-export : [0]
270425 i/no-namespace : [0]
@@ -274,7 +429,7 @@ rules:
274429 i/no-restricted-paths : [0]
275430 i/no-self-import : [2]
276431 i/no-unassigned-import : [0]
277- i/no-unresolved : [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/ ]}]
432+ i/no-unresolved : [2, {commonjs: true, ignore: ["\\?.+$"]}]
278433 i/no-unused-modules : [2, {unusedExports: true}]
279434 i/no-useless-path-segments : [2, {commonjs: true}]
280435 i/no-webpack-loader-syntax : [2]
@@ -294,7 +449,7 @@ rules:
294449 multiline-comment-style : [2, separate-lines]
295450 new-cap : [0]
296451 no-alert : [0]
297- no-array-constructor : [2]
452+ no-array-constructor : [0] # handled by @typescript-eslint/no-array-constructor
298453 no-async-promise-executor : [0]
299454 no-await-in-loop : [0]
300455 no-bitwise : [0]
@@ -319,7 +474,7 @@ rules:
319474 no-dupe-else-if : [2]
320475 no-dupe-keys : [2]
321476 no-duplicate-case : [2]
322- no-duplicate-imports : [2 ]
477+ no-duplicate-imports : [0 ]
323478 no-else-return : [2]
324479 no-empty-character-class : [2]
325480 no-empty-function : [0]
@@ -338,7 +493,7 @@ rules:
338493 no-global-assign : [2]
339494 no-implicit-coercion : [2]
340495 no-implicit-globals : [0]
341- no-implied-eval : [2]
496+ no-implied-eval : [0] # handled by @typescript-eslint/no-implied-eval
342497 no-import-assign : [2]
343498 no-inline-comments : [0]
344499 no-inner-declarations : [2]
@@ -357,7 +512,7 @@ rules:
357512 no-jquery/no-box-model : [2]
358513 no-jquery/no-browser : [2]
359514 no-jquery/no-camel-case : [2]
360- no-jquery/no-class-state : [0 ]
515+ no-jquery/no-class-state : [2 ]
361516 no-jquery/no-class : [0]
362517 no-jquery/no-clone : [2]
363518 no-jquery/no-closest : [0]
@@ -444,7 +599,7 @@ rules:
444599 no-lone-blocks : [2]
445600 no-lonely-if : [0]
446601 no-loop-func : [0]
447- no-loss-of-precision : [2]
602+ no-loss-of-precision : [0] # handled by @typescript-eslint/no-loss-of-precision
448603 no-magic-numbers : [0]
449604 no-misleading-character-class : [2]
450605 no-multi-assign : [0]
@@ -466,12 +621,12 @@ rules:
466621 no-promise-executor-return : [0]
467622 no-proto : [2]
468623 no-prototype-builtins : [2]
469- no-redeclare : [2]
624+ no-redeclare : [0] # must be disabled for typescript overloads
470625 no-regex-spaces : [2]
471626 no-restricted-exports : [0]
472627 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]
473628 no-restricted-imports : [0]
474- no-restricted-syntax : [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.js instead"}]
629+ no-restricted-syntax : [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.ts instead"}]
475630 no-return-assign : [0]
476631 no-script-url : [2]
477632 no-self-assign : [2, {props: true}]
@@ -499,7 +654,7 @@ rules:
499654 no-unused-expressions : [2]
500655 no-unused-labels : [2]
501656 no-unused-private-class-members : [2]
502- no-unused-vars : [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, destructuredArrayIgnorePattern: ^_, ignoreRestSiblings: false}]
657+ no-unused-vars : [0] # handled by @typescript-eslint/no-unused-vars
503658 no-use-before-define : [2, {functions: false, classes: true, variables: true, allowNamedExports: true}]
504659 no-use-extend-native/no-use-extend-native : [2]
505660 no-useless-backreference : [2]
@@ -614,7 +769,7 @@ rules:
614769 regexp/unicode-escape : [0]
615770 regexp/use-ignore-case : [0]
616771 require-atomic-updates : [0]
617- require-await : [0]
772+ require-await : [0] # handled by @typescript-eslint/require-await
618773 require-unicode-regexp : [0]
619774 require-yield : [2]
620775 sonarjs/cognitive-complexity : [0]
0 commit comments