1import eslintCommunityEslintPluginEslintComments from '@eslint-community/eslint-plugin-eslint-comments';
2import stylisticEslintPluginJs from '@stylistic/eslint-plugin-js';
3import vitest from '@vitest/eslint-plugin';
4import arrayFunc from 'eslint-plugin-array-func';
5import eslintPluginImportX from 'eslint-plugin-import-x';
6import noJquery from 'eslint-plugin-no-jquery';
7import noUseExtendNative from 'eslint-plugin-no-use-extend-native';
8import regexp from 'eslint-plugin-regexp';
9import sonarjs from 'eslint-plugin-sonarjs';
10import unicorn from 'eslint-plugin-unicorn';
11import playwright from 'eslint-plugin-playwright';
12import vitestGlobals from 'eslint-plugin-vitest-globals';
13import wc from 'eslint-plugin-wc';
14import globals from 'globals';
15import vue from 'eslint-plugin-vue';
16import vueScopedCss from 'eslint-plugin-vue-scoped-css';
17import toml from 'eslint-plugin-toml';
18import tseslint from 'typescript-eslint';
19
20export default tseslint.config(
21 ...tseslint.configs.recommended,
22 eslintPluginImportX.flatConfigs.typescript,
23 {
24 ignores: ['web_src/js/vendor', 'web_src/fomantic', 'public/assets/js', 'tests/e2e/reports/'],
25 },
26 {
27 plugins: {
28 '@eslint-community/eslint-comments': eslintCommunityEslintPluginEslintComments,
29 '@stylistic/js': stylisticEslintPluginJs,
30 '@vitest': vitest,
31 'array-func': arrayFunc,
32 'no-jquery': noJquery,
33 'no-use-extend-native': noUseExtendNative,
34 regexp,
35 sonarjs,
36 unicorn,
37 playwright,
38 toml,
39 'vitest-globals': vitestGlobals,
40 vue,
41 'vue-scoped-css': vueScopedCss,
42 wc,
43 },
44
45 linterOptions: {
46 reportUnusedDisableDirectives: true,
47 },
48
49 languageOptions: {
50 globals: {
51 ...globals.node,
52 },
53 parserOptions: {
54 ecmaVersion: 'latest',
55 },
56
57 ecmaVersion: 'latest',
58 sourceType: 'module',
59 },
60 rules: {
61 '@typescript-eslint/no-unused-vars': 'off', // TODO: enable this rule again
62
63 '@eslint-community/eslint-comments/disable-enable-pair': [2],
64 '@eslint-community/eslint-comments/no-aggregating-enable': [2],
65 '@eslint-community/eslint-comments/no-duplicate-disable': [2],
66 '@eslint-community/eslint-comments/no-restricted-disable': [0],
67 '@eslint-community/eslint-comments/no-unlimited-disable': [2],
68 '@eslint-community/eslint-comments/no-unused-disable': [2],
69 '@eslint-community/eslint-comments/no-unused-enable': [2],
70 '@eslint-community/eslint-comments/no-use': [0],
71 '@eslint-community/eslint-comments/require-description': [0],
72 '@stylistic/js/array-bracket-newline': [0],
73 '@stylistic/js/array-bracket-spacing': [2, 'never'],
74 '@stylistic/js/array-element-newline': [0],
75 '@stylistic/js/arrow-parens': [2, 'always'],
76
77 '@stylistic/js/arrow-spacing': [2, {
78 before: true,
79 after: true,
80 }],
81
82 '@stylistic/js/block-spacing': [0],
83
84 '@stylistic/js/brace-style': [2, '1tbs', {
85 allowSingleLine: true,
86 }],
87
88 '@stylistic/js/comma-dangle': [2, 'always-multiline'],
89
90 '@stylistic/js/comma-spacing': [2, {
91 before: false,
92 after: true,
93 }],
94
95 '@stylistic/js/comma-style': [2, 'last'],
96 '@stylistic/js/computed-property-spacing': [2, 'never'],
97 '@stylistic/js/dot-location': [2, 'property'],
98 '@stylistic/js/eol-last': [2],
99 '@stylistic/js/function-call-spacing': [2, 'never'],
100 '@stylistic/js/function-call-argument-newline': [0],
101 '@stylistic/js/function-paren-newline': [0],
102 '@stylistic/js/generator-star-spacing': [0],
103 '@stylistic/js/implicit-arrow-linebreak': [0],
104
105 '@stylistic/js/indent': [2, 2, {
106 ignoreComments: true,
107 SwitchCase: 1,
108 }],
109
110 '@stylistic/js/key-spacing': [2],
111 '@stylistic/js/keyword-spacing': [2],
112 '@stylistic/js/linebreak-style': [2, 'unix'],
113 '@stylistic/js/lines-around-comment': [0],
114 '@stylistic/js/lines-between-class-members': [0],
115 '@stylistic/js/max-len': [0],
116 '@stylistic/js/max-statements-per-line': [0],
117 '@stylistic/js/multiline-ternary': [0],
118 '@stylistic/js/new-parens': [2],
119 '@stylistic/js/newline-per-chained-call': [0],
120 '@stylistic/js/no-confusing-arrow': [0],
121 '@stylistic/js/no-extra-parens': [0],
122 '@stylistic/js/no-extra-semi': [2],
123 '@stylistic/js/no-floating-decimal': [0],
124 '@stylistic/js/no-mixed-operators': [0],
125 '@stylistic/js/no-mixed-spaces-and-tabs': [2],
126
127 '@stylistic/js/no-multi-spaces': [2, {
128 ignoreEOLComments: true,
129
130 exceptions: {
131 Property: true,
132 },
133 }],
134
135 '@stylistic/js/no-multiple-empty-lines': [2, {
136 max: 1,
137 maxEOF: 0,
138 maxBOF: 0,
139 }],
140
141 '@stylistic/js/no-tabs': [2],
142 '@stylistic/js/no-trailing-spaces': [2],
143 '@stylistic/js/no-whitespace-before-property': [2],
144 '@stylistic/js/nonblock-statement-body-position': [2],
145 '@stylistic/js/object-curly-newline': [0],
146 '@stylistic/js/object-curly-spacing': [2, 'never'],
147 '@stylistic/js/object-property-newline': [0],
148 '@stylistic/js/one-var-declaration-per-line': [0],
149 '@stylistic/js/operator-linebreak': [2, 'after'],
150 '@stylistic/js/padded-blocks': [2, 'never'],
151 '@stylistic/js/padding-line-between-statements': [0],
152 '@stylistic/js/quote-props': [0],
153
154 '@stylistic/js/quotes': [2, 'single', {
155 avoidEscape: true,
156 allowTemplateLiterals: true,
157 }],
158
159 '@stylistic/js/rest-spread-spacing': [2, 'never'],
160
161 '@stylistic/js/semi': [2, 'always', {
162 omitLastInOneLineBlock: true,
163 }],
164
165 '@stylistic/js/semi-spacing': [2, {
166 before: false,
167 after: true,
168 }],
169
170 '@stylistic/js/semi-style': [2, 'last'],
171 '@stylistic/js/space-before-blocks': [2, 'always'],
172
173 '@stylistic/js/space-before-function-paren': [2, {
174 anonymous: 'ignore',
175 named: 'never',
176 asyncArrow: 'always',
177 }],
178
179 '@stylistic/js/space-in-parens': [2, 'never'],
180 '@stylistic/js/space-infix-ops': [2],
181 '@stylistic/js/space-unary-ops': [2],
182 '@stylistic/js/spaced-comment': [2, 'always'],
183 '@stylistic/js/switch-colon-spacing': [2],
184 '@stylistic/js/template-curly-spacing': [2, 'never'],
185 '@stylistic/js/template-tag-spacing': [2, 'never'],
186 '@stylistic/js/wrap-iife': [2, 'inside'],
187 '@stylistic/js/wrap-regex': [0],
188 '@stylistic/js/yield-star-spacing': [2, 'after'],
189 'accessor-pairs': [2],
190
191 'array-callback-return': [2, {
192 checkForEach: true,
193 }],
194
195 'array-func/avoid-reverse': [2],
196 'array-func/from-map': [2],
197 'array-func/no-unnecessary-this-arg': [2],
198 'array-func/prefer-array-from': [2],
199 'array-func/prefer-flat-map': [0],
200 'array-func/prefer-flat': [0],
201 'arrow-body-style': [0],
202 'block-scoped-var': [2],
203 camelcase: [0],
204 'capitalized-comments': [0],
205 'class-methods-use-this': [0],
206 complexity: [0],
207 'consistent-return': [0],
208 'consistent-this': [0],
209 'constructor-super': [2],
210 curly: [0],
211 'default-case-last': [2],
212 'default-case': [0],
213 'default-param-last': [0],
214 'dot-notation': [0],
215 eqeqeq: [2],
216 'for-direction': [2],
217 'func-name-matching': [2],
218 'func-names': [0],
219 'func-style': [0],
220 'getter-return': [2],
221 'grouped-accessor-pairs': [2],
222 'guard-for-in': [0],
223 'id-blacklist': [0],
224 'id-length': [0],
225 'id-match': [0],
226 'init-declarations': [0],
227 'line-comment-position': [0],
228 'logical-assignment-operators': [0],
229 'max-classes-per-file': [0],
230 'max-depth': [0],
231 'max-lines-per-function': [0],
232 'max-lines': [0],
233 'max-nested-callbacks': [0],
234 'max-params': [0],
235 'max-statements': [0],
236 'multiline-comment-style': [2, 'separate-lines'],
237 'new-cap': [0],
238 'no-alert': [0],
239 'no-array-constructor': [2],
240 'no-async-promise-executor': [0],
241 'no-await-in-loop': [0],
242 'no-bitwise': [0],
243 'no-buffer-constructor': [0],
244 'no-caller': [2],
245 'no-case-declarations': [2],
246 'no-class-assign': [2],
247 'no-compare-neg-zero': [2],
248 'no-cond-assign': [2, 'except-parens'],
249
250 'no-console': [1, {
251 allow: ['debug', 'info', 'warn', 'error'],
252 }],
253
254 'no-const-assign': [2],
255 'no-constant-binary-expression': [2],
256 'no-constant-condition': [0],
257 'no-constructor-return': [2],
258 'no-continue': [0],
259 'no-control-regex': [0],
260 'no-debugger': [1],
261 'no-delete-var': [2],
262 'no-div-regex': [0],
263 'no-dupe-args': [2],
264 'no-dupe-class-members': [2],
265 'no-dupe-else-if': [2],
266 'no-dupe-keys': [2],
267 'no-duplicate-case': [2],
268 'no-duplicate-imports': [2],
269 'no-else-return': [2],
270 'no-empty-character-class': [2],
271 'no-empty-function': [0],
272 'no-empty-pattern': [2],
273 'no-empty-static-block': [2],
274
275 'no-empty': [2, {
276 allowEmptyCatch: true,
277 }],
278
279 'no-eq-null': [2],
280 'no-eval': [2],
281 'no-ex-assign': [2],
282 'no-extend-native': [2],
283 'no-extra-bind': [2],
284 'no-extra-boolean-cast': [2],
285 'no-extra-label': [0],
286 'no-fallthrough': [2],
287 'no-func-assign': [2],
288 'no-global-assign': [2],
289 'no-implicit-coercion': [2],
290 'no-implicit-globals': [0],
291 'no-implied-eval': [2],
292 'no-import-assign': [2],
293 'no-inline-comments': [0],
294 'no-inner-declarations': [2],
295 'no-invalid-regexp': [2],
296 'no-invalid-this': [0],
297 'no-irregular-whitespace': [2],
298 'no-iterator': [2],
299 'no-jquery/no-ajax-events': [2],
300 'no-jquery/no-ajax': [2],
301 'no-jquery/no-and-self': [2],
302 'no-jquery/no-animate-toggle': [2],
303 'no-jquery/no-animate': [2],
304 'no-jquery/no-append-html': [2],
305 'no-jquery/no-attr': [2],
306 'no-jquery/no-bind': [2],
307 'no-jquery/no-box-model': [2],
308 'no-jquery/no-browser': [2],
309 'no-jquery/no-camel-case': [2],
310 'no-jquery/no-class-state': [2],
311 'no-jquery/no-class': [0],
312 'no-jquery/no-clone': [2],
313 'no-jquery/no-closest': [0],
314 'no-jquery/no-constructor-attributes': [2],
315 'no-jquery/no-contains': [2],
316 'no-jquery/no-context-prop': [2],
317 'no-jquery/no-css': [2],
318 'no-jquery/no-data': [0],
319 'no-jquery/no-deferred': [2],
320 'no-jquery/no-delegate': [2],
321 'no-jquery/no-done-fail': [2],
322 'no-jquery/no-each-collection': [0],
323 'no-jquery/no-each-util': [2],
324 'no-jquery/no-each': [0],
325 'no-jquery/no-error-shorthand': [2],
326 'no-jquery/no-error': [2],
327 'no-jquery/no-escape-selector': [2],
328 'no-jquery/no-event-shorthand': [2],
329 'no-jquery/no-extend': [2],
330 'no-jquery/no-fade': [2],
331 'no-jquery/no-filter': [0],
332 'no-jquery/no-find-collection': [0],
333 'no-jquery/no-find-util': [2],
334 'no-jquery/no-find': [0],
335 'no-jquery/no-fx': [2],
336 'no-jquery/no-fx-interval': [2],
337 'no-jquery/no-global-eval': [2],
338 'no-jquery/no-global-selector': [0],
339 'no-jquery/no-grep': [2],
340 'no-jquery/no-has': [2],
341 'no-jquery/no-hold-ready': [2],
342 'no-jquery/no-html': [0],
343 'no-jquery/no-in-array': [2],
344 'no-jquery/no-is-array': [2],
345 'no-jquery/no-is-empty-object': [2],
346 'no-jquery/no-is-function': [2],
347 'no-jquery/no-is-numeric': [2],
348 'no-jquery/no-is-plain-object': [2],
349 'no-jquery/no-is-window': [2],
350 'no-jquery/no-is': [2],
351 'no-jquery/no-jquery-constructor': [0],
352 'no-jquery/no-live': [2],
353 'no-jquery/no-load-shorthand': [2],
354 'no-jquery/no-load': [2],
355 'no-jquery/no-map-collection': [2],
356 'no-jquery/no-map-util': [2],
357 'no-jquery/no-map': [2],
358 'no-jquery/no-merge': [2],
359 'no-jquery/no-node-name': [2],
360 'no-jquery/no-noop': [2],
361 'no-jquery/no-now': [2],
362 'no-jquery/no-on-ready': [2],
363 'no-jquery/no-other-methods': [0],
364 'no-jquery/no-other-utils': [2],
365 'no-jquery/no-param': [2],
366 'no-jquery/no-parent': [0],
367 'no-jquery/no-parents': [2],
368 'no-jquery/no-parse-html-literal': [2],
369 'no-jquery/no-parse-html': [2],
370 'no-jquery/no-parse-json': [2],
371 'no-jquery/no-parse-xml': [2],
372 'no-jquery/no-prop': [2],
373 'no-jquery/no-proxy': [2],
374 'no-jquery/no-ready-shorthand': [2],
375 'no-jquery/no-ready': [2],
376 'no-jquery/no-selector-prop': [2],
377 'no-jquery/no-serialize': [2],
378 'no-jquery/no-size': [2],
379 'no-jquery/no-sizzle': [2],
380 'no-jquery/no-slide': [2],
381 'no-jquery/no-sub': [2],
382 'no-jquery/no-support': [2],
383 'no-jquery/no-text': [0],
384 'no-jquery/no-trigger': [2],
385 'no-jquery/no-trim': [2],
386 'no-jquery/no-type': [2],
387 'no-jquery/no-unique': [2],
388 'no-jquery/no-unload-shorthand': [2],
389 'no-jquery/no-val': [0],
390 'no-jquery/no-visibility': [2],
391 'no-jquery/no-when': [2],
392 'no-jquery/no-wrap': [2],
393 'no-jquery/variable-pattern': [2],
394 'no-label-var': [2],
395 'no-labels': [0],
396 'no-lone-blocks': [2],
397 'no-lonely-if': [0],
398 'no-loop-func': [0],
399 'no-loss-of-precision': [2],
400 'no-magic-numbers': [0],
401 'no-misleading-character-class': [2],
402 'no-multi-assign': [0],
403 'no-multi-str': [2],
404 'no-negated-condition': [0],
405 'no-nested-ternary': [0],
406 'no-new-func': [2],
407 'no-new-native-nonconstructor': [2],
408 'no-new-object': [2],
409 'no-new-symbol': [2],
410 'no-new-wrappers': [2],
411 'no-new': [0],
412 'no-nonoctal-decimal-escape': [2],
413 'no-obj-calls': [2],
414 'no-octal-escape': [2],
415 'no-octal': [2],
416 'no-param-reassign': [0],
417 'no-plusplus': [0],
418 'no-promise-executor-return': [0],
419 'no-proto': [2],
420 'no-prototype-builtins': [2],
421 'no-redeclare': [2],
422 'no-regex-spaces': [2],
423 'no-restricted-exports': [0],
424
425 'no-restricted-globals': [
426 2,
427 'addEventListener',
428 'blur',
429 'close',
430 'closed',
431 'confirm',
432 'defaultStatus',
433 'defaultstatus',
434 'error',
435 'event',
436 'external',
437 'find',
438 'focus',
439 'frameElement',
440 'frames',
441 'history',
442 'innerHeight',
443 'innerWidth',
444 'isFinite',
445 'isNaN',
446 'length',
447 'location',
448 'locationbar',
449 'menubar',
450 'moveBy',
451 'moveTo',
452 'name',
453 'onblur',
454 'onerror',
455 'onfocus',
456 'onload',
457 'onresize',
458 'onunload',
459 'open',
460 'opener',
461 'opera',
462 'outerHeight',
463 'outerWidth',
464 'pageXOffset',
465 'pageYOffset',
466 'parent',
467 'print',
468 'removeEventListener',
469 'resizeBy',
470 'resizeTo',
471 'screen',
472 'screenLeft',
473 'screenTop',
474 'screenX',
475 'screenY',
476 'scroll',
477 'scrollbars',
478 'scrollBy',
479 'scrollTo',
480 'scrollX',
481 'scrollY',
482 'self',
483 'status',
484 'statusbar',
485 'stop',
486 'toolbar',
487 'top',
488 '__dirname',
489 '__filename',
490 ],
491
492 'no-restricted-imports': [0],
493
494 'no-restricted-syntax': [
495 2,
496 'WithStatement',
497 'ForInStatement',
498 'LabeledStatement',
499 'SequenceExpression',
500 {
501 selector: "CallExpression[callee.name='fetch']",
502 message: 'use modules/fetch.js instead',
503 },
504 ],
505
506 'no-return-assign': [0],
507 'no-script-url': [2],
508
509 'no-self-assign': [2, {
510 props: true,
511 }],
512
513 'no-self-compare': [2],
514 'no-sequences': [2],
515 'no-setter-return': [2],
516 'no-shadow-restricted-names': [2],
517 'no-shadow': [0],
518 'no-sparse-arrays': [2],
519 'no-template-curly-in-string': [2],
520 'no-ternary': [0],
521 'no-this-before-super': [2],
522 'no-throw-literal': [2],
523 'no-undef-init': [2],
524
525 'no-undef': [2, {
526 typeof: true,
527 }],
528
529 'no-undefined': [0],
530 'no-underscore-dangle': [0],
531 'no-unexpected-multiline': [2],
532 'no-unmodified-loop-condition': [2],
533 'no-unneeded-ternary': [2],
534 'no-unreachable-loop': [2],
535 'no-unreachable': [2],
536 'no-unsafe-finally': [2],
537 'no-unsafe-negation': [2],
538 'no-unused-expressions': [2],
539 'no-unused-labels': [2],
540 'no-unused-private-class-members': [2],
541
542 'no-unused-vars': [2, {
543 args: 'all',
544 argsIgnorePattern: '^_',
545 varsIgnorePattern: '^_',
546 caughtErrorsIgnorePattern: '^_',
547 destructuredArrayIgnorePattern: '^_',
548 ignoreRestSiblings: false,
549 }],
550
551 'no-use-before-define': [2, {
552 functions: false,
553 classes: true,
554 variables: true,
555 allowNamedExports: true,
556 }],
557
558 'no-use-extend-native/no-use-extend-native': [2],
559 'no-useless-backreference': [2],
560 'no-useless-call': [2],
561 'no-useless-catch': [2],
562 'no-useless-computed-key': [2],
563 'no-useless-concat': [2],
564 'no-useless-constructor': [2],
565 'no-useless-escape': [2],
566 'no-useless-rename': [2],
567 'no-useless-return': [2],
568 'no-var': [2],
569 'no-void': [2],
570 'no-warning-comments': [0],
571 'no-with': [0],
572 'object-shorthand': [2, 'always'],
573 'one-var-declaration-per-line': [0],
574 'one-var': [0],
575 'operator-assignment': [2, 'always'],
576 'operator-linebreak': [2, 'after'],
577
578 'prefer-arrow-callback': [2, {
579 allowNamedFunctions: true,
580 allowUnboundThis: true,
581 }],
582
583 'prefer-const': [2, {
584 destructuring: 'all',
585 ignoreReadBeforeAssign: true,
586 }],
587
588 'prefer-destructuring': [0],
589 'prefer-exponentiation-operator': [2],
590 'prefer-named-capture-group': [0],
591 'prefer-numeric-literals': [2],
592 'prefer-object-has-own': [2],
593 'prefer-object-spread': [2],
594
595 'prefer-promise-reject-errors': [2, {
596 allowEmptyReject: false,
597 }],
598
599 'prefer-regex-literals': [2],
600 'prefer-rest-params': [2],
601 'prefer-spread': [2],
602 'prefer-template': [2],
603 radix: [2, 'as-needed'],
604 'regexp/confusing-quantifier': [2],
605 'regexp/control-character-escape': [2],
606 'regexp/hexadecimal-escape': [0],
607 'regexp/letter-case': [0],
608 'regexp/match-any': [2],
609 'regexp/negation': [2],
610 'regexp/no-contradiction-with-assertion': [0],
611 'regexp/no-control-character': [0],
612 'regexp/no-dupe-characters-character-class': [2],
613 'regexp/no-dupe-disjunctions': [2],
614 'regexp/no-empty-alternative': [2],
615 'regexp/no-empty-capturing-group': [2],
616 'regexp/no-empty-character-class': [0],
617 'regexp/no-empty-group': [2],
618 'regexp/no-empty-lookarounds-assertion': [2],
619 'regexp/no-empty-string-literal': [2],
620 'regexp/no-escape-backspace': [2],
621 'regexp/no-extra-lookaround-assertions': [0],
622 'regexp/no-invalid-regexp': [2],
623 'regexp/no-invisible-character': [2],
624 'regexp/no-lazy-ends': [2],
625 'regexp/no-legacy-features': [2],
626 'regexp/no-misleading-capturing-group': [0],
627 'regexp/no-misleading-unicode-character': [0],
628 'regexp/no-missing-g-flag': [2],
629 'regexp/no-non-standard-flag': [2],
630 'regexp/no-obscure-range': [2],
631 'regexp/no-octal': [2],
632 'regexp/no-optional-assertion': [2],
633 'regexp/no-potentially-useless-backreference': [2],
634 'regexp/no-standalone-backslash': [2],
635 'regexp/no-super-linear-backtracking': [0],
636 'regexp/no-super-linear-move': [0],
637 'regexp/no-trivially-nested-assertion': [2],
638 'regexp/no-trivially-nested-quantifier': [2],
639 'regexp/no-unused-capturing-group': [0],
640 'regexp/no-useless-assertions': [2],
641 'regexp/no-useless-backreference': [2],
642 'regexp/no-useless-character-class': [2],
643 'regexp/no-useless-dollar-replacements': [2],
644 'regexp/no-useless-escape': [2],
645 'regexp/no-useless-flag': [2],
646 'regexp/no-useless-lazy': [2],
647 'regexp/no-useless-non-capturing-group': [2],
648 'regexp/no-useless-quantifier': [2],
649 'regexp/no-useless-range': [2],
650 'regexp/no-useless-set-operand': [2],
651 'regexp/no-useless-string-literal': [2],
652 'regexp/no-useless-two-nums-quantifier': [2],
653 'regexp/no-zero-quantifier': [2],
654 'regexp/optimal-lookaround-quantifier': [2],
655 'regexp/optimal-quantifier-concatenation': [0],
656 'regexp/prefer-character-class': [0],
657 'regexp/prefer-d': [0],
658 'regexp/prefer-escape-replacement-dollar-char': [0],
659 'regexp/prefer-lookaround': [0],
660 'regexp/prefer-named-backreference': [0],
661 'regexp/prefer-named-capture-group': [0],
662 'regexp/prefer-named-replacement': [0],
663 'regexp/prefer-plus-quantifier': [2],
664 'regexp/prefer-predefined-assertion': [2],
665 'regexp/prefer-quantifier': [0],
666 'regexp/prefer-question-quantifier': [2],
667 'regexp/prefer-range': [2],
668 'regexp/prefer-regexp-exec': [2],
669 'regexp/prefer-regexp-test': [2],
670 'regexp/prefer-result-array-groups': [0],
671 'regexp/prefer-set-operation': [2],
672 'regexp/prefer-star-quantifier': [2],
673 'regexp/prefer-unicode-codepoint-escapes': [2],
674 'regexp/prefer-w': [0],
675 'regexp/require-unicode-regexp': [0],
676 'regexp/simplify-set-operations': [2],
677 'regexp/sort-alternatives': [0],
678 'regexp/sort-character-class-elements': [0],
679 'regexp/sort-flags': [0],
680 'regexp/strict': [2],
681 'regexp/unicode-escape': [0],
682 'regexp/use-ignore-case': [0],
683 'require-atomic-updates': [0],
684 'require-await': [0],
685 'require-unicode-regexp': [0],
686 'require-yield': [2],
687 'sonarjs/cognitive-complexity': [0],
688 'sonarjs/elseif-without-else': [0],
689 'sonarjs/max-switch-cases': [0],
690 'sonarjs/no-all-duplicated-branches': [2],
691 'sonarjs/no-collapsible-if': [0],
692 'sonarjs/no-collection-size-mischeck': [2],
693 'sonarjs/no-duplicate-string': [0],
694 'sonarjs/no-duplicated-branches': [0],
695 'sonarjs/no-element-overwrite': [2],
696 'sonarjs/no-empty-collection': [2],
697 'sonarjs/no-extra-arguments': [2],
698 'sonarjs/no-gratuitous-expressions': [2],
699 'sonarjs/no-identical-conditions': [2],
700 'sonarjs/no-identical-expressions': [2],
701 'sonarjs/no-identical-functions': [2, 5],
702 'sonarjs/no-ignored-return': [2],
703 'sonarjs/no-inverted-boolean-check': [2],
704 'sonarjs/no-nested-switch': [0],
705 'sonarjs/no-nested-template-literals': [0],
706 'sonarjs/no-one-iteration-loop': [2],
707 'sonarjs/no-redundant-boolean': [2],
708 'sonarjs/no-redundant-jump': [2],
709 'sonarjs/no-same-line-conditional': [2],
710 'sonarjs/no-small-switch': [0],
711 'sonarjs/no-unused-collection': [2],
712 'sonarjs/no-use-of-empty-return-value': [2],
713 'sonarjs/no-useless-catch': [2],
714 'sonarjs/non-existent-operator': [2],
715 'sonarjs/prefer-immediate-return': [0],
716 'sonarjs/prefer-object-literal': [0],
717 'sonarjs/prefer-single-boolean-return': [0],
718 'sonarjs/prefer-while': [2],
719 'sort-imports': [0],
720 'sort-keys': [0],
721 'sort-vars': [0],
722 strict: [0],
723 'symbol-description': [2],
724 'unicode-bom': [2, 'never'],
725 'unicorn/better-regex': [0],
726 'unicorn/catch-error-name': [0],
727 'unicorn/consistent-assert': [0],
728 'unicorn/consistent-date-clone': [2],
729 'unicorn/consistent-destructuring': [2],
730 'unicorn/consistent-empty-array-spread': [2],
731 'unicorn/consistent-existence-index-check': [2],
732 'unicorn/consistent-function-scoping': [2],
733 'unicorn/custom-error-definition': [0],
734 'unicorn/empty-brace-spaces': [2],
735 'unicorn/error-message': [0],
736 'unicorn/escape-case': [0],
737 'unicorn/expiring-todo-comments': [0],
738 'unicorn/explicit-length-check': [0],
739 'unicorn/filename-case': [0],
740 'unicorn/import-index': [0],
741 'unicorn/import-style': [0],
742 'unicorn/new-for-builtins': [2],
743 'unicorn/no-accessor-recursion': [2],
744 'unicorn/no-abusive-eslint-disable': [0],
745 'unicorn/no-anonymous-default-export': [0],
746 'unicorn/no-array-callback-reference': [0],
747 'unicorn/no-array-for-each': [2],
748 'unicorn/no-array-method-this-argument': [2],
749 'unicorn/no-array-push-push': [2],
750 'unicorn/no-array-reduce': [2],
751 'unicorn/no-await-expression-member': [0],
752 'unicorn/no-await-in-promise-methods': [2],
753 'unicorn/no-console-spaces': [0],
754 'unicorn/no-document-cookie': [2],
755 'unicorn/no-empty-file': [2],
756 'unicorn/no-for-loop': [0],
757 'unicorn/no-hex-escape': [0],
758 'unicorn/no-instanceof-builtins': [0],
759 'unicorn/no-invalid-fetch-options': [2],
760 'unicorn/no-invalid-remove-event-listener': [2],
761 'unicorn/no-keyword-prefix': [0],
762 'unicorn/no-length-as-slice-end': [2],
763 'unicorn/no-lonely-if': [2],
764 'unicorn/no-magic-array-flat-depth': [0],
765 'unicorn/no-named-default': [2],
766 'unicorn/no-negated-condition': [0],
767 'unicorn/no-negation-in-equality-check': [2],
768 'unicorn/no-nested-ternary': [0],
769 'unicorn/no-new-array': [0],
770 'unicorn/no-new-buffer': [0],
771 'unicorn/no-null': [0],
772 'unicorn/no-object-as-default-parameter': [0],
773 'unicorn/no-process-exit': [0],
774 'unicorn/no-single-promise-in-promise-methods': [2],
775 'unicorn/no-static-only-class': [2],
776 'unicorn/no-thenable': [2],
777 'unicorn/no-this-assignment': [2],
778 'unicorn/no-typeof-undefined': [2],
779 'unicorn/no-unnecessary-await': [2],
780 'unicorn/no-unnecessary-polyfills': [2],
781 'unicorn/no-unreadable-array-destructuring': [0],
782 'unicorn/no-unreadable-iife': [2],
783 'unicorn/no-unused-properties': [2],
784 'unicorn/no-useless-fallback-in-spread': [2],
785 'unicorn/no-useless-length-check': [2],
786 'unicorn/no-useless-promise-resolve-reject': [2],
787 'unicorn/no-useless-spread': [2],
788 'unicorn/no-useless-switch-case': [2],
789 'unicorn/no-useless-undefined': [0],
790 'unicorn/no-zero-fractions': [2],
791 'unicorn/number-literal-case': [0],
792 'unicorn/numeric-separators-style': [0],
793 'unicorn/prefer-add-event-listener': [2],
794 'unicorn/prefer-array-find': [2],
795 'unicorn/prefer-array-flat-map': [2],
796 'unicorn/prefer-array-flat': [2],
797 'unicorn/prefer-array-index-of': [2],
798 'unicorn/prefer-array-some': [2],
799 'unicorn/prefer-at': [0],
800 'unicorn/prefer-blob-reading-methods': [2],
801 'unicorn/prefer-code-point': [0],
802 'unicorn/prefer-date-now': [2],
803 'unicorn/prefer-default-parameters': [0],
804 'unicorn/prefer-dom-node-append': [2],
805 'unicorn/prefer-dom-node-dataset': [0],
806 'unicorn/prefer-dom-node-remove': [2],
807 'unicorn/prefer-dom-node-text-content': [2],
808 'unicorn/prefer-event-target': [2],
809 'unicorn/prefer-export-from': [0],
810 'unicorn/prefer-global-this': [0],
811 'unicorn/prefer-includes': [2],
812 'unicorn/prefer-json-parse-buffer': [0],
813 'unicorn/prefer-keyboard-event-key': [2],
814 'unicorn/prefer-logical-operator-over-ternary': [2],
815 'unicorn/prefer-math-min-max': [2],
816 'unicorn/prefer-math-trunc': [2],
817 'unicorn/prefer-modern-dom-apis': [0],
818 'unicorn/prefer-modern-math-apis': [2],
819 'unicorn/prefer-module': [2],
820 'unicorn/prefer-native-coercion-functions': [2],
821 'unicorn/prefer-negative-index': [2],
822 'unicorn/prefer-node-protocol': [2],
823 'unicorn/prefer-number-properties': [0],
824 'unicorn/prefer-object-from-entries': [2],
825 'unicorn/prefer-object-has-own': [0],
826 'unicorn/prefer-optional-catch-binding': [2],
827 'unicorn/prefer-prototype-methods': [0],
828 'unicorn/prefer-query-selector': [0],
829 'unicorn/prefer-reflect-apply': [0],
830 'unicorn/prefer-regexp-test': [2],
831 'unicorn/prefer-set-has': [0],
832 'unicorn/prefer-set-size': [2],
833 'unicorn/prefer-spread': [0],
834 'unicorn/prefer-string-raw': [0],
835 'unicorn/prefer-string-replace-all': [0],
836 'unicorn/prefer-string-slice': [0],
837 'unicorn/prefer-string-starts-ends-with': [2],
838 'unicorn/prefer-string-trim-start-end': [2],
839 'unicorn/prefer-structured-clone': [2],
840 'unicorn/prefer-switch': [0],
841 'unicorn/prefer-ternary': [0],
842 'unicorn/prefer-top-level-await': [0],
843 'unicorn/prefer-type-error': [0],
844 'unicorn/prevent-abbreviations': [0],
845 'unicorn/relative-url-style': [2],
846 'unicorn/require-array-join-separator': [2],
847 'unicorn/require-number-to-fixed-digits-argument': [2],
848 'unicorn/require-post-message-target-origin': [0],
849 'unicorn/string-content': [0],
850 'unicorn/switch-case-braces': [0],
851 'unicorn/template-indent': [2],
852 'unicorn/text-encoding-identifier-case': [0],
853 'unicorn/throw-new-error': [2],
854 'use-isnan': [2],
855
856 'valid-typeof': [2, {
857 requireStringLiterals: true,
858 }],
859
860 'vars-on-top': [0],
861 'wc/attach-shadow-constructor': [2],
862 'wc/define-tag-after-class-definition': [0],
863 'wc/expose-class-on-global': [0],
864 'wc/file-name-matches-element': [2],
865 'wc/guard-define-call': [0],
866 'wc/guard-super-call': [2],
867 'wc/max-elements-per-file': [0],
868 'wc/no-child-traversal-in-attributechangedcallback': [2],
869 'wc/no-child-traversal-in-connectedcallback': [2],
870 'wc/no-closed-shadow-root': [2],
871 'wc/no-constructor-attributes': [2],
872 'wc/no-constructor-params': [2],
873 'wc/no-constructor': [2],
874 'wc/no-customized-built-in-elements': [2],
875 'wc/no-exports-with-element': [0],
876 'wc/no-invalid-element-name': [2],
877 'wc/no-invalid-extends': [2],
878 'wc/no-method-prefixed-with-on': [2],
879 'wc/no-self-class': [2],
880 'wc/no-typos': [2],
881 'wc/require-listener-teardown': [2],
882 'wc/tag-name-matches-class': [2],
883 yoda: [2, 'never'],
884 },
885 },
886 {
887 ignores: ['*.vue', '**/*.vue'],
888 rules: {
889 'import-x/consistent-type-specifier-style': [0],
890 'import-x/default': [0],
891 'import-x/dynamic-import-chunkname': [0],
892 'import-x/export': [2],
893 'import-x/exports-last': [0],
894
895 'import-x/extensions': [2, 'always', {
896 ignorePackages: true,
897 }],
898
899 'import-x/first': [2],
900 'import-x/group-exports': [0],
901 'import-x/max-dependencies': [0],
902 'import-x/named': [2],
903 'import-x/namespace': [0],
904 'import-x/newline-after-import': [0],
905 'import-x/no-absolute-path': [0],
906 'import-x/no-amd': [2],
907 'import-x/no-anonymous-default-export': [0],
908 'import-x/no-commonjs': [2],
909
910 'import-x/no-cycle': [2, {
911 ignoreExternal: true,
912 maxDepth: 1,
913 }],
914
915 'import-x/no-default-export': [0],
916 'import-x/no-deprecated': [0],
917 'import-x/no-dynamic-require': [0],
918 'import-x/no-empty-named-blocks': [2],
919 'import-x/no-extraneous-dependencies': [2],
920 'import-x/no-import-module-exports': [0],
921 'import-x/no-internal-modules': [0],
922 'import-x/no-mutable-exports': [0],
923 'import-x/no-named-as-default-member': [0],
924 'import-x/no-named-as-default': [2],
925 'import-x/no-named-default': [0],
926 'import-x/no-named-export': [0],
927 'import-x/no-namespace': [0],
928 'import-x/no-nodejs-modules': [0],
929 'import-x/no-relative-packages': [0],
930 'import-x/no-relative-parent-imports': [0],
931 'import-x/no-restricted-paths': [0],
932 'import-x/no-self-import': [2],
933 'import-x/no-unassigned-import': [0],
934
935 'import-x/no-unresolved': [2, {
936 commonjs: true,
937 ignore: ['\\?.+$', '^vitest/'],
938 }],
939
940 'import-x/no-useless-path-segments': [2, {
941 commonjs: true,
942 }],
943
944 'import-x/no-webpack-loader-syntax': [2],
945 'import-x/order': [0],
946 'import-x/prefer-default-export': [0],
947 'import-x/unambiguous': [0],
948 },
949 },
950 {
951 files: ['web_src/**/*'],
952 languageOptions: {
953 globals: {
954 __webpack_public_path__: true,
955 process: false,
956 },
957 },
958 }, {
959 files: ['web_src/**/*', 'docs/**/*'],
960
961 languageOptions: {
962 globals: {
963 ...globals.browser,
964 },
965 },
966 }, {
967 files: ['web_src/**/*worker.*'],
968
969 languageOptions: {
970 globals: {
971 ...globals.worker,
972 },
973 },
974
975 rules: {
976 'no-restricted-globals': [
977 2,
978 'addEventListener',
979 'blur',
980 'close',
981 'closed',
982 'confirm',
983 'defaultStatus',
984 'defaultstatus',
985 'error',
986 'event',
987 'external',
988 'find',
989 'focus',
990 'frameElement',
991 'frames',
992 'history',
993 'innerHeight',
994 'innerWidth',
995 'isFinite',
996 'isNaN',
997 'length',
998 'locationbar',
999 'menubar',
1000 'moveBy',
1001 'moveTo',
1002 'name',
1003 'onblur',
1004 'onerror',
1005 'onfocus',
1006 'onload',
1007 'onresize',
1008 'onunload',
1009 'open',
1010 'opener',
1011 'opera',
1012 'outerHeight',
1013 'outerWidth',
1014 'pageXOffset',
1015 'pageYOffset',
1016 'parent',
1017 'print',
1018 'removeEventListener',
1019 'resizeBy',
1020 'resizeTo',
1021 'screen',
1022 'screenLeft',
1023 'screenTop',
1024 'screenX',
1025 'screenY',
1026 'scroll',
1027 'scrollbars',
1028 'scrollBy',
1029 'scrollTo',
1030 'scrollX',
1031 'scrollY',
1032 'status',
1033 'statusbar',
1034 'stop',
1035 'toolbar',
1036 'top',
1037 ],
1038 },
1039 }, {
1040 files: ['**/*.config.*'],
1041 languageOptions: {
1042 ecmaVersion: 'latest',
1043 },
1044 rules: {
1045 'import-x/no-unused-modules': [0],
1046 'import-x/no-unresolved': [0],
1047 'import-x/no-named-as-default': [0],
1048 },
1049 }, {
1050 files: ['**/*.test.*', 'web_src/js/test/setup.js'],
1051 languageOptions: {
1052 globals: {
1053 ...vitestGlobals.environments.env.globals,
1054 },
1055 },
1056
1057 rules: {
1058 '@vitest/consistent-test-filename': [0],
1059 '@vitest/consistent-test-it': [0],
1060 '@vitest/expect-expect': [0],
1061 '@vitest/max-expects': [0],
1062 '@vitest/max-nested-describe': [0],
1063 '@vitest/no-alias-methods': [0],
1064 '@vitest/no-commented-out-tests': [0],
1065 '@vitest/no-conditional-expect': [0],
1066 '@vitest/no-conditional-in-test': [0],
1067 '@vitest/no-conditional-tests': [0],
1068 '@vitest/no-disabled-tests': [0],
1069 '@vitest/no-done-callback': [0],
1070 '@vitest/no-duplicate-hooks': [0],
1071 '@vitest/no-focused-tests': [0],
1072 '@vitest/no-hooks': [0],
1073 '@vitest/no-identical-title': [2],
1074 '@vitest/no-interpolation-in-snapshots': [0],
1075 '@vitest/no-large-snapshots': [0],
1076 '@vitest/no-mocks-import': [0],
1077 '@vitest/no-restricted-matchers': [0],
1078 '@vitest/no-restricted-vi-methods': [0],
1079 '@vitest/no-standalone-expect': [0],
1080 '@vitest/no-test-prefixes': [0],
1081 '@vitest/no-test-return-statement': [0],
1082 '@vitest/prefer-called-with': [0],
1083 '@vitest/prefer-comparison-matcher': [0],
1084 '@vitest/prefer-each': [0],
1085 '@vitest/prefer-equality-matcher': [0],
1086 '@vitest/prefer-expect-resolves': [0],
1087 '@vitest/prefer-hooks-in-order': [0],
1088 '@vitest/prefer-hooks-on-top': [2],
1089 '@vitest/prefer-lowercase-title': [0],
1090 '@vitest/prefer-mock-promise-shorthand': [0],
1091 '@vitest/prefer-snapshot-hint': [0],
1092 '@vitest/prefer-spy-on': [0],
1093 '@vitest/prefer-strict-equal': [0],
1094 '@vitest/prefer-to-be': [0],
1095 '@vitest/prefer-to-be-falsy': [0],
1096 '@vitest/prefer-to-be-object': [0],
1097 '@vitest/prefer-to-be-truthy': [0],
1098 '@vitest/prefer-to-contain': [0],
1099 '@vitest/prefer-to-have-length': [0],
1100 '@vitest/prefer-todo': [0],
1101 '@vitest/require-hook': [0],
1102 '@vitest/require-to-throw-message': [0],
1103 '@vitest/require-top-level-describe': [0],
1104 '@vitest/valid-describe-callback': [2],
1105 '@vitest/valid-expect': [2],
1106 '@vitest/valid-title': [2],
1107 },
1108 }, {
1109 files: ['web_src/js/modules/fetch.js', 'web_src/js/standalone/**/*'],
1110
1111 rules: {
1112 'no-restricted-syntax': [
1113 2,
1114 'WithStatement',
1115 'ForInStatement',
1116 'LabeledStatement',
1117 'SequenceExpression',
1118 ],
1119 },
1120 }, {
1121 files: ['tests/e2e/**/*.ts'],
1122 languageOptions: {
1123 globals: {
1124 ...globals.browser,
1125 },
1126
1127 ecmaVersion: 'latest',
1128 sourceType: 'module',
1129 },
1130 rules: {
1131 ...playwright.configs['flat/recommended'].rules,
1132 'playwright/no-conditional-in-test': [0],
1133 'playwright/no-conditional-expect': [0],
1134 // allow grouping helper functions with tests
1135 'unicorn/consistent-function-scoping': [0],
1136
1137 'playwright/no-skipped-test': [
1138 2,
1139 {
1140 allowConditional: true,
1141 },
1142 ],
1143 'playwright/no-useless-await': [2],
1144
1145 'playwright/prefer-comparison-matcher': [2],
1146 'playwright/prefer-equality-matcher': [2],
1147 'playwright/prefer-native-locators': [2],
1148 'playwright/prefer-to-contain': [2],
1149 'playwright/prefer-to-have-length': [2],
1150 'playwright/require-to-throw-message': [2],
1151 },
1152 },
1153 ...vue.configs['flat/recommended'],
1154 {
1155 files: ['web_src/js/components/*.vue'],
1156 languageOptions: {
1157 globals: {
1158 ...globals.browser,
1159 },
1160
1161 ecmaVersion: 'latest',
1162 sourceType: 'module',
1163 },
1164 rules: {
1165 'vue/attributes-order': [0],
1166 'vue/html-closing-bracket-spacing': [2, {
1167 startTag: 'never',
1168 endTag: 'never',
1169 selfClosingTag: 'never',
1170 }],
1171 'vue/max-attributes-per-line': [0],
1172 'vue-scoped-css/enforce-style-type': [0],
1173 },
1174 },
1175 ...toml.configs['flat/recommended'],
1176);