eslint-config-webpack 4.15.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -4
- package/configs/browser.js +70 -7
- package/configs/index.js +7 -6
- package/configs/javascript.js +746 -151
- package/configs/json.js +72 -0
- package/configs/markdown.js +111 -6
- package/configs/node.js +78 -23
- package/configs/performance.js +8 -0
- package/configs/react.js +7 -19
- package/configs/stylistic.js +17 -0
- package/configs/{jest.js → test.js} +65 -5
- package/configs/typescript.js +39 -10
- package/configs/utils/code-files.js +20 -0
- package/configs/utils/get-es-version-from-node.js +9 -4
- package/configs/utils/get-json-file.js +1 -5
- package/configs/utils/is-jest-installed.js +20 -0
- package/configs/utils/is-typescript-installed.js +3 -3
- package/configs.js +47 -31
- package/package.json +31 -26
- package/plugins/package-json/index.js +0 -5
- package/plugins/package-json/rules/order-properties.js +8 -18
- package/plugins/performance/index.js +60 -0
- package/plugins/performance/rules/no-case-insensitive-unicode-range.js +214 -0
- package/plugins/performance/rules/require-precompiled-schema.js +414 -0
- package/plugins/webpack/index.js +0 -1
- package/plugins/webpack/rules/comment-length.js +1 -3
- package/plugins/webpack/rules/format-schema.js +18 -16
- package/plugins/webpack/rules/inherit-jsdoc.js +2 -3
- package/plugins/webpack/rules/no-duplicate-import-tag.js +3 -4
- package/plugins/webpack/rules/no-unused-import-tag.js +8 -11
- package/plugins/webpack/rules/prefer-import-tag.js +1 -2
- package/plugins/webpack/rules/require-license-comment.js +3 -5
- package/plugins/webpack/rules/valid-schema.js +9 -13
- package/plugins/webpack/utils/import-tags.js +4 -3
- package/configs/package-json.js +0 -8
package/configs/javascript.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import javascriptConfig from "@eslint/js";
|
|
2
|
-
import importPlugin from "eslint-plugin-import";
|
|
2
|
+
import importPlugin from "eslint-plugin-import-x";
|
|
3
3
|
import unicornPlugin from "eslint-plugin-unicorn";
|
|
4
4
|
import globals from "globals";
|
|
5
5
|
import { allExtensions, javascriptExtensions } from "./utils/extensions.js";
|
|
@@ -27,7 +27,7 @@ const possibleProblems = {
|
|
|
27
27
|
// "no-async-promise-executor": "error"
|
|
28
28
|
|
|
29
29
|
// No need
|
|
30
|
-
|
|
30
|
+
"no-await-in-loop": "off",
|
|
31
31
|
|
|
32
32
|
// From recommended
|
|
33
33
|
// "no-class-assign": "error",
|
|
@@ -131,7 +131,8 @@ const possibleProblems = {
|
|
|
131
131
|
// From recommended
|
|
132
132
|
// "no-this-before-super": "error",
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
// From recommended
|
|
135
|
+
// "no-unassigned-vars": "error",
|
|
135
136
|
|
|
136
137
|
// From recommended
|
|
137
138
|
// "no-undef": "error",
|
|
@@ -180,8 +181,8 @@ const possibleProblems = {
|
|
|
180
181
|
{ functions: true, classes: true, variables: true },
|
|
181
182
|
],
|
|
182
183
|
|
|
183
|
-
//
|
|
184
|
-
|
|
184
|
+
// TODO Do we need it?
|
|
185
|
+
"no-useless-assignment": "off",
|
|
185
186
|
|
|
186
187
|
// From recommended
|
|
187
188
|
// "no-useless-backreference": "error",
|
|
@@ -218,25 +219,24 @@ const suggestions = {
|
|
|
218
219
|
],
|
|
219
220
|
|
|
220
221
|
// No need
|
|
221
|
-
|
|
222
|
+
"capitalized-comments": "off",
|
|
222
223
|
|
|
223
224
|
// No need
|
|
224
|
-
|
|
225
|
+
"class-methods-use-this": "off",
|
|
225
226
|
|
|
226
227
|
// No need
|
|
227
|
-
|
|
228
|
+
complexity: "off",
|
|
228
229
|
|
|
229
230
|
// No need
|
|
230
|
-
|
|
231
|
+
"consistent-return": "off",
|
|
231
232
|
|
|
232
233
|
// No need
|
|
233
|
-
|
|
234
|
+
"consistent-this": "off",
|
|
234
235
|
|
|
235
236
|
// Configuration in `stylistic`
|
|
236
|
-
|
|
237
|
+
curly: "off",
|
|
237
238
|
|
|
238
|
-
|
|
239
|
-
// "default-case": "error",
|
|
239
|
+
"default-case": "off",
|
|
240
240
|
|
|
241
241
|
"default-case-last": "error",
|
|
242
242
|
|
|
@@ -273,7 +273,7 @@ const suggestions = {
|
|
|
273
273
|
// "guard-for-in": "error",
|
|
274
274
|
|
|
275
275
|
// No need
|
|
276
|
-
|
|
276
|
+
"id-denylist": "off",
|
|
277
277
|
|
|
278
278
|
"id-length": [
|
|
279
279
|
"error",
|
|
@@ -313,30 +313,30 @@ const suggestions = {
|
|
|
313
313
|
],
|
|
314
314
|
|
|
315
315
|
// No need
|
|
316
|
-
|
|
316
|
+
"init-declarations": "off",
|
|
317
317
|
|
|
318
318
|
"logical-assignment-operators": "error",
|
|
319
319
|
|
|
320
320
|
// No need
|
|
321
|
-
|
|
321
|
+
"max-classes-per-file": "off",
|
|
322
322
|
|
|
323
323
|
// No need
|
|
324
|
-
|
|
324
|
+
"max-depth": "off",
|
|
325
325
|
|
|
326
326
|
// No need
|
|
327
|
-
|
|
327
|
+
"max-lines": "off",
|
|
328
328
|
|
|
329
329
|
// No need
|
|
330
|
-
|
|
330
|
+
"max-lines-per-function": "off",
|
|
331
331
|
|
|
332
332
|
// No need
|
|
333
|
-
|
|
333
|
+
"max-nested-callbacks": "off",
|
|
334
334
|
|
|
335
335
|
// No need
|
|
336
|
-
|
|
336
|
+
"max-params": "off",
|
|
337
337
|
|
|
338
338
|
// No need
|
|
339
|
-
|
|
339
|
+
"max-statements": "off",
|
|
340
340
|
|
|
341
341
|
// For `prop-types`
|
|
342
342
|
"new-cap": ["error", { capIsNewExceptionPattern: "^.+Type$" }],
|
|
@@ -346,7 +346,7 @@ const suggestions = {
|
|
|
346
346
|
"no-array-constructor": "error",
|
|
347
347
|
|
|
348
348
|
// No need
|
|
349
|
-
|
|
349
|
+
"no-bitwise": "off",
|
|
350
350
|
|
|
351
351
|
"no-caller": "error",
|
|
352
352
|
|
|
@@ -356,7 +356,7 @@ const suggestions = {
|
|
|
356
356
|
"no-console": "error",
|
|
357
357
|
|
|
358
358
|
// No need
|
|
359
|
-
|
|
359
|
+
"no-continue": "off",
|
|
360
360
|
|
|
361
361
|
// From recommended
|
|
362
362
|
// "no-delete-var": "error",
|
|
@@ -381,7 +381,6 @@ const suggestions = {
|
|
|
381
381
|
],
|
|
382
382
|
},
|
|
383
383
|
],
|
|
384
|
-
// "no-empty-function": "error"
|
|
385
384
|
|
|
386
385
|
// From recommended
|
|
387
386
|
// "no-empty-static-block": "error"
|
|
@@ -417,7 +416,7 @@ const suggestions = {
|
|
|
417
416
|
"no-implied-eval": "error",
|
|
418
417
|
|
|
419
418
|
// No need
|
|
420
|
-
|
|
419
|
+
"no-inline-comments": "off",
|
|
421
420
|
|
|
422
421
|
// No need
|
|
423
422
|
// "no-invalid-this": "error",
|
|
@@ -436,7 +435,7 @@ const suggestions = {
|
|
|
436
435
|
"no-loop-func": "error",
|
|
437
436
|
|
|
438
437
|
// No need
|
|
439
|
-
|
|
438
|
+
"no-magic-numbers": "off",
|
|
440
439
|
|
|
441
440
|
// No need
|
|
442
441
|
// "no-multi-assign": "off",
|
|
@@ -444,10 +443,10 @@ const suggestions = {
|
|
|
444
443
|
"no-multi-str": "error",
|
|
445
444
|
|
|
446
445
|
// No need
|
|
447
|
-
|
|
446
|
+
"no-negated-condition": "off",
|
|
448
447
|
|
|
449
448
|
// No need
|
|
450
|
-
|
|
449
|
+
"no-nested-ternary": "off",
|
|
451
450
|
|
|
452
451
|
"no-new": "error",
|
|
453
452
|
|
|
@@ -466,10 +465,10 @@ const suggestions = {
|
|
|
466
465
|
"no-octal-escape": "error",
|
|
467
466
|
|
|
468
467
|
// No need
|
|
469
|
-
|
|
468
|
+
"no-param-reassign": "off",
|
|
470
469
|
|
|
471
470
|
// No need
|
|
472
|
-
|
|
471
|
+
"no-plusplus": "off",
|
|
473
472
|
|
|
474
473
|
"no-proto": "error",
|
|
475
474
|
|
|
@@ -480,19 +479,19 @@ const suggestions = {
|
|
|
480
479
|
// "no-regex-spaces": "error",
|
|
481
480
|
|
|
482
481
|
// No need
|
|
483
|
-
|
|
482
|
+
"no-restricted-exports": "error",
|
|
484
483
|
|
|
485
484
|
// No need
|
|
486
|
-
|
|
485
|
+
"no-restricted-globals": "error",
|
|
487
486
|
|
|
488
487
|
// No need
|
|
489
|
-
|
|
488
|
+
"no-restricted-imports": "off",
|
|
490
489
|
|
|
491
490
|
// No need
|
|
492
|
-
|
|
491
|
+
"no-restricted-properties": "off",
|
|
493
492
|
|
|
494
493
|
// No need
|
|
495
|
-
|
|
494
|
+
"no-restricted-syntax": "off",
|
|
496
495
|
|
|
497
496
|
"no-return-assign": "error",
|
|
498
497
|
|
|
@@ -501,23 +500,23 @@ const suggestions = {
|
|
|
501
500
|
"no-sequences": "error",
|
|
502
501
|
|
|
503
502
|
// No need
|
|
504
|
-
|
|
503
|
+
"no-shadow": "off",
|
|
505
504
|
|
|
506
505
|
// From recommended
|
|
507
506
|
// "no-shadow-restricted-names": "error",
|
|
508
507
|
|
|
509
508
|
// No need
|
|
510
|
-
|
|
509
|
+
"no-ternary": "off",
|
|
511
510
|
|
|
512
511
|
"no-throw-literal": "error",
|
|
513
512
|
|
|
514
513
|
"no-undef-init": "error",
|
|
515
514
|
|
|
516
515
|
// No need
|
|
517
|
-
|
|
516
|
+
"no-undefined": "off",
|
|
518
517
|
|
|
519
518
|
// No need
|
|
520
|
-
|
|
519
|
+
"no-underscore-dangle": "off",
|
|
521
520
|
|
|
522
521
|
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
523
522
|
|
|
@@ -543,7 +542,7 @@ const suggestions = {
|
|
|
543
542
|
"no-useless-concat": "error",
|
|
544
543
|
|
|
545
544
|
// No need
|
|
546
|
-
|
|
545
|
+
"no-useless-constructor": "off",
|
|
547
546
|
|
|
548
547
|
"no-useless-escape": "error",
|
|
549
548
|
|
|
@@ -629,7 +628,8 @@ const suggestions = {
|
|
|
629
628
|
|
|
630
629
|
"prefer-template": "error",
|
|
631
630
|
|
|
632
|
-
|
|
631
|
+
// From recommended
|
|
632
|
+
// "preserve-caught-error": "error",
|
|
633
633
|
|
|
634
634
|
radix: ["error", "always"],
|
|
635
635
|
|
|
@@ -646,17 +646,17 @@ const suggestions = {
|
|
|
646
646
|
// "sort-imports": "off",
|
|
647
647
|
|
|
648
648
|
// No need
|
|
649
|
-
|
|
649
|
+
"sort-keys": "off",
|
|
650
650
|
|
|
651
651
|
// No need
|
|
652
|
-
|
|
652
|
+
"sort-vars": "off",
|
|
653
653
|
|
|
654
654
|
strict: ["error", "global"],
|
|
655
655
|
|
|
656
656
|
"symbol-description": "error",
|
|
657
657
|
|
|
658
658
|
// No need
|
|
659
|
-
|
|
659
|
+
"vars-on-top": "off",
|
|
660
660
|
|
|
661
661
|
yoda: "error",
|
|
662
662
|
};
|
|
@@ -668,16 +668,39 @@ const layoutAndFormatting = {
|
|
|
668
668
|
|
|
669
669
|
/** @type {import("eslint").Linter.Config["rules"]} */
|
|
670
670
|
const unicornRules = {
|
|
671
|
-
//
|
|
672
|
-
|
|
671
|
+
// Not here and no need, define only for `browsers`
|
|
672
|
+
"unicorn/better-dom-traversing": "off",
|
|
673
|
+
|
|
674
|
+
// TODO Do we really need? Need verify readable
|
|
675
|
+
// "unicorn/class-reference-in-static-methods": "error",
|
|
673
676
|
|
|
674
677
|
"unicorn/catch-error-name": [
|
|
675
678
|
"error",
|
|
676
679
|
{ name: "err", ignore: [/(^_|[0-9]+$)/i, /^error$/] },
|
|
677
680
|
],
|
|
678
681
|
|
|
682
|
+
// No need
|
|
683
|
+
"unicorn/comma-spacing": "off",
|
|
684
|
+
|
|
685
|
+
// No need
|
|
686
|
+
"unicorn/comment-content": "off",
|
|
687
|
+
|
|
688
|
+
// No need
|
|
689
|
+
"unicorn/consistent-arrow-return-style": "off",
|
|
690
|
+
|
|
679
691
|
"unicorn/consistent-assert": "error",
|
|
680
692
|
|
|
693
|
+
// TODO enable it in future
|
|
694
|
+
// "unicorn/consistent-boolean-name": "error",
|
|
695
|
+
|
|
696
|
+
// TODO enable it in future
|
|
697
|
+
// "unicorn/consistent-class-member-order": "error",
|
|
698
|
+
|
|
699
|
+
// TODO enable it in future
|
|
700
|
+
// "unicorn/consistent-compound-words": "error",
|
|
701
|
+
|
|
702
|
+
"unicorn/consistent-conditional-object-spread": "error",
|
|
703
|
+
|
|
681
704
|
"unicorn/consistent-date-clone": "error",
|
|
682
705
|
|
|
683
706
|
"unicorn/consistent-destructuring": "off",
|
|
@@ -687,26 +710,46 @@ const unicornRules = {
|
|
|
687
710
|
// No need
|
|
688
711
|
// "unicorn/consistent-existence-index-check": "off",
|
|
689
712
|
|
|
713
|
+
// No need
|
|
714
|
+
// "unicorn/consistent-export-decorator-position": "off",
|
|
715
|
+
|
|
690
716
|
// No need
|
|
691
717
|
// "unicorn/consistent-function-scoping": "off",
|
|
692
718
|
|
|
719
|
+
// Every option defaults to `ignore`, so it reports nothing without a style for each role
|
|
720
|
+
// "unicorn/consistent-function-style": "off",
|
|
721
|
+
|
|
722
|
+
"unicorn/consistent-json-file-read": "error",
|
|
723
|
+
|
|
724
|
+
"unicorn/consistent-optional-chaining": "error",
|
|
725
|
+
|
|
693
726
|
"unicorn/consistent-template-literal-escape": "error",
|
|
694
727
|
|
|
695
|
-
|
|
696
|
-
// "unicorn/custom-error-definition": "off",
|
|
728
|
+
"unicorn/consistent-tuple-labels": "error",
|
|
697
729
|
|
|
698
|
-
//
|
|
699
|
-
|
|
730
|
+
// TODO Do we need it?
|
|
731
|
+
"unicorn/custom-error-definition": "off",
|
|
732
|
+
|
|
733
|
+
// TODO investiagte
|
|
734
|
+
"unicorn/default-export-style": "off",
|
|
735
|
+
|
|
736
|
+
// Not here, define only for `browsers`
|
|
737
|
+
"unicorn/dom-node-dataset": "off",
|
|
738
|
+
|
|
739
|
+
// No need, we have prettier
|
|
740
|
+
"unicorn/empty-brace-spaces": "off",
|
|
700
741
|
|
|
701
742
|
"unicorn/error-message": "error",
|
|
702
743
|
|
|
703
744
|
"unicorn/escape-case": "error",
|
|
704
745
|
|
|
705
746
|
// No need
|
|
706
|
-
|
|
747
|
+
"unicorn/expiring-todo-comments": "off",
|
|
707
748
|
|
|
708
749
|
// No need
|
|
709
|
-
|
|
750
|
+
"unicorn/explicit-length-check": "off",
|
|
751
|
+
|
|
752
|
+
"unicorn/explicit-timer-delay": "error",
|
|
710
753
|
|
|
711
754
|
// TODO enable in future?
|
|
712
755
|
"unicorn/filename-case": [
|
|
@@ -734,11 +777,31 @@ const unicornRules = {
|
|
|
734
777
|
},
|
|
735
778
|
],
|
|
736
779
|
|
|
780
|
+
// No need, we have the same eslint rule
|
|
781
|
+
"unicorn/id-match": "off",
|
|
782
|
+
|
|
737
783
|
// No need
|
|
738
|
-
|
|
784
|
+
"unicorn/import-style": "off",
|
|
739
785
|
|
|
740
786
|
// No need
|
|
741
|
-
|
|
787
|
+
"unicorn/indent": "off",
|
|
788
|
+
|
|
789
|
+
// No need
|
|
790
|
+
"unicorn/isolated-functions": "off",
|
|
791
|
+
|
|
792
|
+
"unicorn/iteration-fallback-style": ["error", "fallback"],
|
|
793
|
+
|
|
794
|
+
// TODO enable in future
|
|
795
|
+
"unicorn/key-name-casing": "off",
|
|
796
|
+
|
|
797
|
+
// No need, we have the same eslint rule
|
|
798
|
+
"unicorn/logical-assignment-operators": "off",
|
|
799
|
+
|
|
800
|
+
// No need
|
|
801
|
+
"unicorn/max-nested-calls": "off",
|
|
802
|
+
|
|
803
|
+
// No need
|
|
804
|
+
"unicorn/name-replacements": "off",
|
|
742
805
|
|
|
743
806
|
"unicorn/new-for-builtins": "error",
|
|
744
807
|
|
|
@@ -746,67 +809,207 @@ const unicornRules = {
|
|
|
746
809
|
|
|
747
810
|
"unicorn/no-accessor-recursion": "error",
|
|
748
811
|
|
|
749
|
-
|
|
750
|
-
// "unicorn/no-anonymous-default-export": "off",
|
|
812
|
+
"unicorn/no-accidental-bitwise-operator": "error",
|
|
751
813
|
|
|
752
|
-
//
|
|
814
|
+
// TODO Do we need it
|
|
815
|
+
// "unicorn/no-anonymous-default-export": "error",
|
|
816
|
+
|
|
817
|
+
// TODO Enable it
|
|
753
818
|
// "unicorn/no-array-callback-reference": "off",
|
|
754
819
|
|
|
755
|
-
"unicorn/no-array-
|
|
820
|
+
"unicorn/no-array-concat-in-loop": "error",
|
|
756
821
|
|
|
757
|
-
"unicorn/no-array-
|
|
822
|
+
"unicorn/no-array-fill-with-reference-type": "error",
|
|
823
|
+
|
|
824
|
+
"unicorn/no-array-from-fill": "error",
|
|
758
825
|
|
|
759
826
|
// No need
|
|
760
|
-
|
|
827
|
+
"unicorn/no-array-front-mutation": "off",
|
|
828
|
+
|
|
829
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
761
830
|
|
|
762
831
|
// No need
|
|
763
|
-
|
|
832
|
+
"unicorn/no-array-reduce": "off",
|
|
833
|
+
|
|
834
|
+
"unicorn/no-array-reverse": "off",
|
|
764
835
|
|
|
765
836
|
"unicorn/no-array-sort": "error",
|
|
766
837
|
|
|
838
|
+
"unicorn/no-array-sort-for-min-max": "error",
|
|
839
|
+
|
|
840
|
+
"unicorn/no-array-splice": "error",
|
|
841
|
+
|
|
842
|
+
// No need
|
|
843
|
+
// "unicorn/no-asterisk-prefix-in-documentation-comments": "off",
|
|
844
|
+
|
|
845
|
+
"unicorn/no-async-iterator-callback": "error",
|
|
846
|
+
|
|
847
|
+
"unicorn/no-async-promise-finally": "error",
|
|
848
|
+
|
|
767
849
|
// No need
|
|
768
850
|
// "unicorn/no-await-expression-member": "off",
|
|
769
851
|
|
|
770
852
|
"unicorn/no-await-in-promise-methods": "error",
|
|
771
853
|
|
|
854
|
+
// No need
|
|
855
|
+
"unicorn/no-barrel-files": "off",
|
|
856
|
+
|
|
857
|
+
"unicorn/no-blob-to-file": "error",
|
|
858
|
+
|
|
859
|
+
"unicorn/no-boolean-sort-comparator": "error",
|
|
860
|
+
|
|
861
|
+
// No need
|
|
862
|
+
"unicorn/no-break-in-nested-loop": "off",
|
|
863
|
+
|
|
864
|
+
// Not here, define only for `browsers`
|
|
865
|
+
// "unicorn/no-canvas-to-image": "off",
|
|
866
|
+
|
|
867
|
+
"unicorn/no-chained-comparison": "error",
|
|
868
|
+
|
|
869
|
+
"unicorn/no-collection-bracket-access": "error",
|
|
870
|
+
|
|
871
|
+
// No need
|
|
872
|
+
// "unicorn/no-computed-property-existence-check": "off",
|
|
873
|
+
|
|
874
|
+
"unicorn/no-conflicting-constraints": "error",
|
|
875
|
+
|
|
876
|
+
// No need
|
|
877
|
+
"unicorn/no-confusing-array-splice": "off",
|
|
878
|
+
|
|
879
|
+
// No need
|
|
880
|
+
"unicorn/no-confusing-array-with": "off",
|
|
881
|
+
|
|
772
882
|
"unicorn/no-console-spaces": "error",
|
|
773
883
|
|
|
884
|
+
"unicorn/no-constant-zero-expression": "error",
|
|
885
|
+
|
|
886
|
+
// TODO Do we need it?
|
|
887
|
+
// "unicorn/no-declarations-before-early-exit": "error",
|
|
888
|
+
|
|
774
889
|
// No need
|
|
775
890
|
// "unicorn/no-document-cookie": "off",
|
|
776
891
|
|
|
777
|
-
|
|
778
|
-
|
|
892
|
+
"unicorn/no-double-comparison": "error",
|
|
893
|
+
|
|
894
|
+
"unicorn/no-duplicate-if-branches": "error",
|
|
895
|
+
|
|
896
|
+
"unicorn/no-duplicate-logical-operands": "error",
|
|
897
|
+
|
|
898
|
+
"unicorn/no-duplicate-loops": "error",
|
|
899
|
+
|
|
900
|
+
"unicorn/no-duplicate-set-values": "error",
|
|
901
|
+
|
|
902
|
+
"unicorn/no-empty-file": "error",
|
|
903
|
+
|
|
904
|
+
// Markdown only, enabled in `markdown/recommended`
|
|
905
|
+
// "unicorn/no-empty-link-text": "off",
|
|
906
|
+
|
|
907
|
+
"unicorn/no-exports-in-scripts": "error",
|
|
908
|
+
|
|
909
|
+
"unicorn/no-for-each": "error",
|
|
779
910
|
|
|
780
911
|
// No need
|
|
781
912
|
// "unicorn/no-for-loop": "off",
|
|
782
913
|
|
|
783
|
-
|
|
914
|
+
// No need
|
|
915
|
+
// "unicorn/no-global-object-property-assignment": "off",
|
|
784
916
|
|
|
785
917
|
// No need
|
|
786
|
-
// "unicorn/no-immediate-mutation": "
|
|
918
|
+
// "unicorn/no-immediate-mutation": "off",
|
|
919
|
+
|
|
920
|
+
"unicorn/no-impossible-length-comparison": "error",
|
|
921
|
+
|
|
922
|
+
"unicorn/no-incomplete-accessor-override": "error",
|
|
923
|
+
|
|
924
|
+
// Not here, define only for `browsers`
|
|
925
|
+
// "unicorn/no-incorrect-query-selector": "off",
|
|
926
|
+
|
|
927
|
+
"unicorn/no-incorrect-template-string-interpolation": "error",
|
|
928
|
+
|
|
929
|
+
// TODO implement HTML preset
|
|
930
|
+
// "unicorn/no-ineffective-csp-directives": "off",
|
|
787
931
|
|
|
788
932
|
"unicorn/no-instanceof-builtins": "error",
|
|
789
933
|
|
|
934
|
+
"unicorn/no-invalid-argument-count": "error",
|
|
935
|
+
|
|
936
|
+
// Not here, define only for `browsers`
|
|
937
|
+
// "unicorn/no-invalid-boolean-attribute-value": "error",
|
|
938
|
+
|
|
939
|
+
"unicorn/no-invalid-character-comparison": "error",
|
|
940
|
+
|
|
941
|
+
// Not here, define only for `browsers`
|
|
942
|
+
// "unicorn/no-invalid-dom-token": "off",
|
|
943
|
+
|
|
790
944
|
"unicorn/no-invalid-fetch-options": "error",
|
|
791
945
|
|
|
946
|
+
"unicorn/no-invalid-file-input-accept": "error",
|
|
947
|
+
|
|
948
|
+
"unicorn/no-invalid-integrity": "error",
|
|
949
|
+
|
|
950
|
+
"unicorn/no-invalid-intl-options": "error",
|
|
951
|
+
|
|
952
|
+
"unicorn/no-invalid-property-descriptor": "error",
|
|
953
|
+
|
|
792
954
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
793
955
|
|
|
956
|
+
"unicorn/no-invalid-response-options": "error",
|
|
957
|
+
|
|
958
|
+
// Not here, define only for `browsers`
|
|
959
|
+
// "unicorn/no-invalid-style-set-property": "error",
|
|
960
|
+
|
|
961
|
+
"unicorn/no-invalid-temporal-arithmetic": "error",
|
|
962
|
+
|
|
963
|
+
"unicorn/no-invalid-url-protocol-comparison": "error",
|
|
964
|
+
|
|
965
|
+
"unicorn/no-invalid-well-known-symbol-methods": "error",
|
|
966
|
+
|
|
967
|
+
// Markdown only, enabled in `markdown/recommended`
|
|
968
|
+
// "unicorn/no-javascript-url": "off",
|
|
969
|
+
|
|
794
970
|
// No need
|
|
795
971
|
// "unicorn/no-keyword-prefix": "off",
|
|
796
972
|
|
|
973
|
+
// Not here, define only for `browsers`
|
|
974
|
+
// "unicorn/no-late-current-target-access": "off",
|
|
975
|
+
|
|
976
|
+
"unicorn/no-leading-empty-lines": "error",
|
|
977
|
+
|
|
797
978
|
"unicorn/no-lonely-if": "error",
|
|
798
979
|
|
|
980
|
+
// TODO Do we need it?
|
|
981
|
+
// "unicorn/no-loop-iterable-mutation": "off",
|
|
982
|
+
|
|
983
|
+
// No need we have `no-loss-of-precision`, this rule only for JSON and etc
|
|
984
|
+
// "unicorn/no-loss-of-precision": "error",
|
|
985
|
+
|
|
799
986
|
// No need
|
|
800
987
|
// "unicorn/no-magic-array-flat-depth": "error",
|
|
801
988
|
|
|
989
|
+
// No need TODO enable?
|
|
990
|
+
// "unicorn/no-manually-wrapped-comments": "off",
|
|
991
|
+
|
|
992
|
+
"unicorn/no-mismatched-map-key": "error",
|
|
993
|
+
|
|
994
|
+
"unicorn/no-misrefactored-assignment": "error",
|
|
995
|
+
|
|
996
|
+
// TODO enable for html, css and etc
|
|
997
|
+
"unicorn/no-missing-local-resource": "error",
|
|
998
|
+
|
|
999
|
+
"unicorn/no-multiple-promise-resolver-calls": "error",
|
|
1000
|
+
|
|
802
1001
|
// No need
|
|
803
1002
|
// "unicorn/no-named-default": "error",
|
|
804
1003
|
|
|
805
|
-
|
|
1004
|
+
"unicorn/no-negated-array-predicate": "error",
|
|
1005
|
+
|
|
1006
|
+
// TODO enable checkLogicalExpressions?
|
|
1007
|
+
"unicorn/no-negated-comparison": "error",
|
|
1008
|
+
|
|
1009
|
+
// TODO Do we need it?
|
|
806
1010
|
// "unicorn/no-negated-condition": "off",
|
|
807
1011
|
|
|
808
|
-
|
|
809
|
-
// "unicorn/no-negation-in-equality-check": "off",
|
|
1012
|
+
"unicorn/no-negation-in-equality-check": "error",
|
|
810
1013
|
|
|
811
1014
|
// No need
|
|
812
1015
|
// "unicorn/no-nested-ternary": "off",
|
|
@@ -817,49 +1020,158 @@ const unicornRules = {
|
|
|
817
1020
|
// We are catching this in `node/no-deprecated-api` rule
|
|
818
1021
|
// "unicorn/no-new-buffer": "off",
|
|
819
1022
|
|
|
1023
|
+
// TODO Enable in future
|
|
1024
|
+
// "unicorn/no-non-function-verb-prefix": "error",
|
|
1025
|
+
|
|
1026
|
+
// No need - use typescript
|
|
1027
|
+
// "unicorn/no-nonstandard-builtin-properties": "off",
|
|
1028
|
+
|
|
820
1029
|
// No need
|
|
821
|
-
|
|
1030
|
+
"unicorn/no-null": "off",
|
|
822
1031
|
|
|
823
1032
|
// No need
|
|
824
1033
|
// "unicorn/no-object-as-default-parameter": "off",
|
|
825
1034
|
|
|
1035
|
+
"unicorn/no-object-methods-with-collections": "error",
|
|
1036
|
+
|
|
1037
|
+
"unicorn/no-optional-chaining-on-undeclared-variable": "error",
|
|
1038
|
+
|
|
1039
|
+
"unicorn/no-prevent-default-in-passive-listener": "error",
|
|
1040
|
+
|
|
826
1041
|
// No need
|
|
827
1042
|
// "unicorn/no-process-exit": "off",
|
|
828
1043
|
|
|
1044
|
+
"unicorn/no-redundant-comparison": "error",
|
|
1045
|
+
|
|
1046
|
+
// No need
|
|
1047
|
+
"unicorn/no-repeated-call-wrappers": "off",
|
|
1048
|
+
|
|
1049
|
+
"unicorn/no-return-array-push": "error",
|
|
1050
|
+
|
|
1051
|
+
// TODO enable for CSS
|
|
1052
|
+
// "unicorn/no-shorthand-property-overrides": "error",
|
|
1053
|
+
|
|
829
1054
|
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
830
1055
|
|
|
831
1056
|
// No need
|
|
832
1057
|
// "unicorn/no-static-only-class": "off",
|
|
833
1058
|
|
|
1059
|
+
"unicorn/no-subtraction-comparison": "error",
|
|
1060
|
+
|
|
834
1061
|
"unicorn/no-thenable": "error",
|
|
835
1062
|
|
|
836
1063
|
// No need
|
|
837
1064
|
// "unicorn/no-this-assignment": "off",
|
|
838
1065
|
|
|
839
|
-
//
|
|
840
|
-
|
|
1066
|
+
// No need
|
|
1067
|
+
"unicorn/no-this-outside-of-class": "off",
|
|
1068
|
+
|
|
1069
|
+
// TODO we need to think how refactor webpack to enable it, it is useful for initial start
|
|
1070
|
+
// "unicorn/no-top-level-assignment-in-function": "off",
|
|
1071
|
+
|
|
1072
|
+
// TODO need testing
|
|
1073
|
+
// "unicorn/no-top-level-side-effects": "off",
|
|
1074
|
+
|
|
1075
|
+
// TODO Enable for CSS
|
|
1076
|
+
"unicorn/no-transition-all": "off",
|
|
1077
|
+
|
|
1078
|
+
// Only for variables and properties, `typeof` stays for globals, which may be undeclared
|
|
1079
|
+
// TODO enable in future
|
|
1080
|
+
// "unicorn/no-typeof-undefined": "error",
|
|
1081
|
+
|
|
1082
|
+
"unicorn/no-uncalled-method": "error",
|
|
1083
|
+
|
|
1084
|
+
// No need, please use typescript
|
|
1085
|
+
"unicorn/no-undeclared-class-members": "off",
|
|
841
1086
|
|
|
842
1087
|
"unicorn/no-unnecessary-array-flat-depth": "error",
|
|
843
1088
|
|
|
1089
|
+
"unicorn/no-unnecessary-array-flat-map": "error",
|
|
1090
|
+
|
|
844
1091
|
"unicorn/no-unnecessary-array-splice-count": "error",
|
|
845
1092
|
|
|
846
1093
|
"unicorn/no-unnecessary-await": "error",
|
|
847
1094
|
|
|
1095
|
+
"unicorn/no-unnecessary-boolean-comparison": "error",
|
|
1096
|
+
|
|
1097
|
+
// No need
|
|
1098
|
+
// "unicorn/no-unnecessary-default-arguments": "off",
|
|
1099
|
+
|
|
1100
|
+
"unicorn/no-unnecessary-fetch-options": "error",
|
|
1101
|
+
|
|
1102
|
+
// TODO disable for global
|
|
1103
|
+
// "unicorn/no-unnecessary-global-this": "off",
|
|
1104
|
+
|
|
1105
|
+
"unicorn/no-unnecessary-nested-ternary": "error",
|
|
1106
|
+
|
|
1107
|
+
// TODO test it
|
|
1108
|
+
// "unicorn/no-unnecessary-parameters": "off",
|
|
1109
|
+
|
|
848
1110
|
"unicorn/no-unnecessary-polyfills": "error",
|
|
849
1111
|
|
|
850
1112
|
"unicorn/no-unnecessary-slice-end": "error",
|
|
851
1113
|
|
|
1114
|
+
"unicorn/no-unnecessary-splice": "error",
|
|
1115
|
+
|
|
1116
|
+
"unicorn/no-unnecessary-string-trim": "error",
|
|
1117
|
+
|
|
852
1118
|
// No need
|
|
853
1119
|
// "unicorn/no-unreadable-array-destructuring": "off",
|
|
854
1120
|
|
|
855
1121
|
// No need
|
|
856
|
-
|
|
1122
|
+
"unicorn/no-unreadable-for-of-expression": "off",
|
|
1123
|
+
|
|
1124
|
+
"unicorn/no-unreadable-iife": "error",
|
|
1125
|
+
|
|
1126
|
+
// No need
|
|
1127
|
+
"unicorn/no-unreadable-new-expression": "off",
|
|
1128
|
+
|
|
1129
|
+
// TODO Do we need it?
|
|
1130
|
+
// "unicorn/no-unreadable-object-destructuring": "error",
|
|
1131
|
+
|
|
1132
|
+
"unicorn/no-unsafe-buffer-conversion": "error",
|
|
1133
|
+
|
|
1134
|
+
// Not here, define only for `browsers`
|
|
1135
|
+
"unicorn/no-unsafe-dom-html": "off",
|
|
1136
|
+
|
|
1137
|
+
"unicorn/no-unsafe-json-serialization": "error",
|
|
1138
|
+
|
|
1139
|
+
"unicorn/no-unsafe-promise-all-settled-values": "error",
|
|
1140
|
+
|
|
1141
|
+
"unicorn/no-unsafe-property-key": "error",
|
|
1142
|
+
|
|
1143
|
+
// No need
|
|
1144
|
+
// "unicorn/no-unsafe-sqlite-interpolation": "off",
|
|
1145
|
+
|
|
1146
|
+
// No need
|
|
1147
|
+
// "unicorn/no-unsafe-string-replacement": "off",
|
|
1148
|
+
|
|
1149
|
+
"unicorn/no-unused-builtin-method-return": "error",
|
|
1150
|
+
|
|
1151
|
+
"unicorn/no-unused-iterator-helper": "error",
|
|
857
1152
|
|
|
858
1153
|
// No need
|
|
859
1154
|
// "unicorn/no-unused-properties": "off",
|
|
860
1155
|
|
|
1156
|
+
"unicorn/no-url-in-search-params": "error",
|
|
1157
|
+
|
|
1158
|
+
"unicorn/no-useless-boolean-cast": "error",
|
|
1159
|
+
|
|
1160
|
+
"unicorn/no-useless-coercion": "error",
|
|
1161
|
+
|
|
861
1162
|
"unicorn/no-useless-collection-argument": "error",
|
|
862
1163
|
|
|
1164
|
+
"unicorn/no-useless-compound-assignment": "error",
|
|
1165
|
+
|
|
1166
|
+
"unicorn/no-useless-concat": "error",
|
|
1167
|
+
|
|
1168
|
+
"unicorn/no-useless-continue": "error",
|
|
1169
|
+
|
|
1170
|
+
"unicorn/no-useless-delete-check": "error",
|
|
1171
|
+
|
|
1172
|
+
// TODO enable in future
|
|
1173
|
+
// "unicorn/no-useless-else": "error",
|
|
1174
|
+
|
|
863
1175
|
"unicorn/no-useless-error-capture-stack-trace": "error",
|
|
864
1176
|
|
|
865
1177
|
"unicorn/no-useless-fallback-in-spread": "error",
|
|
@@ -868,16 +1180,33 @@ const unicornRules = {
|
|
|
868
1180
|
|
|
869
1181
|
"unicorn/no-useless-length-check": "error",
|
|
870
1182
|
|
|
1183
|
+
"unicorn/no-useless-logical-operand": "error",
|
|
1184
|
+
|
|
1185
|
+
"unicorn/no-useless-override": "error",
|
|
1186
|
+
|
|
871
1187
|
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
872
1188
|
|
|
1189
|
+
"unicorn/no-useless-re-export": "error",
|
|
1190
|
+
|
|
1191
|
+
"unicorn/no-useless-recursion": "error",
|
|
1192
|
+
|
|
1193
|
+
"unicorn/no-useless-set-construction": "error",
|
|
1194
|
+
|
|
873
1195
|
"unicorn/no-useless-spread": "error",
|
|
874
1196
|
|
|
875
1197
|
// No need
|
|
876
1198
|
// "unicorn/no-useless-switch-case": "off",
|
|
877
1199
|
|
|
1200
|
+
"unicorn/no-useless-template-literals": "error",
|
|
1201
|
+
|
|
878
1202
|
// No need
|
|
879
1203
|
// "unicorn/no-useless-undefined": "off",
|
|
880
1204
|
|
|
1205
|
+
"unicorn/no-using-resource-escape": "error",
|
|
1206
|
+
|
|
1207
|
+
// No need
|
|
1208
|
+
// "unicorn/no-xor-as-exponentiation": "off",
|
|
1209
|
+
|
|
881
1210
|
"unicorn/no-zero-fractions": "error",
|
|
882
1211
|
|
|
883
1212
|
// No need
|
|
@@ -888,7 +1217,19 @@ const unicornRules = {
|
|
|
888
1217
|
// "unicorn/numeric-separators-style": "off",
|
|
889
1218
|
|
|
890
1219
|
// No need
|
|
891
|
-
// "unicorn/
|
|
1220
|
+
// "unicorn/operator-assignment": "off",
|
|
1221
|
+
|
|
1222
|
+
"unicorn/prefer-abort-signal-any": "error",
|
|
1223
|
+
|
|
1224
|
+
"unicorn/prefer-abort-signal-timeout": "error",
|
|
1225
|
+
|
|
1226
|
+
// Not here, define only for `browsers`
|
|
1227
|
+
// "unicorn/prefer-add-event-listener": "error",
|
|
1228
|
+
|
|
1229
|
+
// Not here, define only for `browsers`
|
|
1230
|
+
// "unicorn/prefer-add-event-listener-options": "error",
|
|
1231
|
+
|
|
1232
|
+
"unicorn/prefer-aggregate-error": "error",
|
|
892
1233
|
|
|
893
1234
|
"unicorn/prefer-array-find": "error",
|
|
894
1235
|
|
|
@@ -896,73 +1237,168 @@ const unicornRules = {
|
|
|
896
1237
|
|
|
897
1238
|
"unicorn/prefer-array-flat-map": "error",
|
|
898
1239
|
|
|
1240
|
+
"unicorn/prefer-array-from-async": "error",
|
|
1241
|
+
|
|
1242
|
+
"unicorn/prefer-array-from-map": "error",
|
|
1243
|
+
|
|
1244
|
+
"unicorn/prefer-array-from-range": "error",
|
|
1245
|
+
|
|
899
1246
|
"unicorn/prefer-array-index-of": "error",
|
|
900
1247
|
|
|
1248
|
+
"unicorn/prefer-array-iterable-methods": "error",
|
|
1249
|
+
|
|
1250
|
+
"unicorn/prefer-array-last-methods": "error",
|
|
1251
|
+
|
|
1252
|
+
"unicorn/prefer-array-slice": "error",
|
|
1253
|
+
|
|
901
1254
|
"unicorn/prefer-array-some": "error",
|
|
902
1255
|
|
|
903
|
-
//
|
|
904
|
-
|
|
1256
|
+
// Disabled for ECMAScript < 2022
|
|
1257
|
+
"unicorn/prefer-at": "error",
|
|
1258
|
+
|
|
1259
|
+
// TODO enable in future
|
|
1260
|
+
// "unicorn/prefer-await": "error",
|
|
905
1261
|
|
|
906
1262
|
"unicorn/prefer-bigint-literals": "error",
|
|
907
1263
|
|
|
908
1264
|
"unicorn/prefer-blob-reading-methods": "error",
|
|
909
1265
|
|
|
1266
|
+
"unicorn/prefer-block-statement-over-iife": "error",
|
|
1267
|
+
|
|
1268
|
+
"unicorn/prefer-boolean-return": "error",
|
|
1269
|
+
|
|
910
1270
|
"unicorn/prefer-class-fields": "error",
|
|
911
1271
|
|
|
912
1272
|
// Not here, define only for `browsers`
|
|
913
|
-
|
|
1273
|
+
"unicorn/prefer-classlist-toggle": "off",
|
|
914
1274
|
|
|
915
1275
|
// No need
|
|
916
1276
|
// "unicorn/prefer-code-point": "error",
|
|
917
1277
|
|
|
1278
|
+
// TODO enable in future
|
|
1279
|
+
// "unicorn/prefer-combined-guards": "error",
|
|
1280
|
+
|
|
1281
|
+
// TODO Enable it in future
|
|
1282
|
+
// "unicorn/prefer-continue": "error",
|
|
1283
|
+
|
|
918
1284
|
"unicorn/prefer-date-now": "error",
|
|
919
1285
|
|
|
920
1286
|
"unicorn/prefer-default-parameters": "error",
|
|
921
1287
|
|
|
1288
|
+
"unicorn/prefer-direct-iteration": "error",
|
|
1289
|
+
|
|
1290
|
+
// TODO enable in future
|
|
1291
|
+
// "unicorn/prefer-dispose": "off",
|
|
1292
|
+
|
|
922
1293
|
// Not here, define only for `browsers`
|
|
923
1294
|
// "unicorn/prefer-dom-node-append": "error",
|
|
924
1295
|
|
|
925
1296
|
// Not here, define only for `browsers`
|
|
926
|
-
// "unicorn/prefer-dom-node-
|
|
1297
|
+
// "unicorn/prefer-dom-node-html-methods": "error",
|
|
927
1298
|
|
|
928
1299
|
// Not here, define only for `browsers`
|
|
929
1300
|
// "unicorn/prefer-dom-node-remove": "error",
|
|
930
1301
|
|
|
1302
|
+
// Not here, define only for `browsers`
|
|
1303
|
+
// "unicorn/prefer-dom-node-replace-children": "error",
|
|
1304
|
+
|
|
931
1305
|
// Not here, define only for `browsers`
|
|
932
1306
|
// "unicorn/prefer-dom-node-text-content": "error",
|
|
933
1307
|
|
|
1308
|
+
// TODO Do we need it?
|
|
1309
|
+
// "unicorn/prefer-early-return": "error",
|
|
1310
|
+
|
|
1311
|
+
"unicorn/prefer-else-if": "error",
|
|
1312
|
+
|
|
1313
|
+
// Disabled for ECMAScript < 2026
|
|
1314
|
+
"unicorn/prefer-error-is-error": "error",
|
|
1315
|
+
|
|
1316
|
+
"unicorn/prefer-escaped-irregular-whitespace": "error",
|
|
1317
|
+
|
|
934
1318
|
"unicorn/prefer-event-target": "error",
|
|
935
1319
|
|
|
936
1320
|
"unicorn/prefer-export-from": "error",
|
|
937
1321
|
|
|
938
|
-
"unicorn/prefer-
|
|
1322
|
+
"unicorn/prefer-flat-math-min-max": "error",
|
|
1323
|
+
|
|
1324
|
+
"unicorn/prefer-get-or-insert-computed": "error",
|
|
939
1325
|
|
|
940
1326
|
// No need
|
|
1327
|
+
// "unicorn/prefer-global-number-constants": "off",
|
|
1328
|
+
|
|
1329
|
+
"unicorn/prefer-global-this": "error",
|
|
1330
|
+
|
|
1331
|
+
// Disabled for ECMAScript < 2024
|
|
1332
|
+
"unicorn/prefer-group-by": "error",
|
|
1333
|
+
|
|
1334
|
+
"unicorn/prefer-has-check": "error",
|
|
1335
|
+
|
|
1336
|
+
"unicorn/prefer-hoisting-branch-code": "error",
|
|
1337
|
+
|
|
1338
|
+
"unicorn/prefer-https": "error",
|
|
1339
|
+
|
|
1340
|
+
"unicorn/prefer-identifier-import-export-specifiers": "error",
|
|
1341
|
+
|
|
1342
|
+
// Node.js only, enabled in `node/module` when `engines.node` allows it
|
|
941
1343
|
// "unicorn/prefer-import-meta-properties": "off",
|
|
942
1344
|
|
|
943
1345
|
"unicorn/prefer-includes": "error",
|
|
944
1346
|
|
|
945
|
-
//
|
|
946
|
-
// "unicorn/prefer-
|
|
1347
|
+
// TODO Enable in future
|
|
1348
|
+
// "unicorn/prefer-includes-over-repeated-comparisons": "error",
|
|
1349
|
+
|
|
1350
|
+
"unicorn/prefer-iterable-in-constructor": "error",
|
|
1351
|
+
|
|
1352
|
+
// Disabled for ECMAScript < 2026
|
|
1353
|
+
// TODO Do we need it
|
|
1354
|
+
"unicorn/prefer-iterator-concat": "off",
|
|
1355
|
+
|
|
1356
|
+
// Disabled for ECMAScript < 2025
|
|
1357
|
+
"unicorn/prefer-iterator-helpers": "error",
|
|
1358
|
+
|
|
1359
|
+
// Disabled for ECMAScript < 2025
|
|
1360
|
+
"unicorn/prefer-iterator-to-array": "error",
|
|
1361
|
+
|
|
1362
|
+
// Disabled for ECMAScript < 2025
|
|
1363
|
+
"unicorn/prefer-iterator-to-array-at-end": "error",
|
|
1364
|
+
|
|
1365
|
+
// TODO enable only for fresh Nodejs?
|
|
1366
|
+
// "unicorn/prefer-iterator-zip": "off",
|
|
1367
|
+
|
|
1368
|
+
// Node.js prints an `ExperimentalWarning` for JSON modules before 22.12 and 23.1,
|
|
1369
|
+
// which the ECMAScript version can't tell apart
|
|
1370
|
+
// "unicorn/prefer-json-import": "off",
|
|
947
1371
|
|
|
948
1372
|
// Not here, define only for `browsers`
|
|
949
1373
|
// "unicorn/prefer-keyboard-event-key": "error",
|
|
950
1374
|
|
|
1375
|
+
"unicorn/prefer-literal-ascii": "error",
|
|
1376
|
+
|
|
951
1377
|
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
952
1378
|
|
|
1379
|
+
// TODO Do not need
|
|
1380
|
+
// "unicorn/prefer-map-from-entries": "off",
|
|
1381
|
+
|
|
953
1382
|
// No need
|
|
954
|
-
// "unicorn/prefer-math-
|
|
1383
|
+
// "unicorn/prefer-math-abs": "off",
|
|
1384
|
+
|
|
1385
|
+
// No need
|
|
1386
|
+
// "unicorn/prefer-math-constants": "off",
|
|
1387
|
+
|
|
1388
|
+
"unicorn/prefer-math-min-max": "error",
|
|
955
1389
|
|
|
956
1390
|
// No need
|
|
957
1391
|
// `| 0` is faster
|
|
958
1392
|
// "unicorn/prefer-math-trunc": "off",
|
|
959
1393
|
|
|
1394
|
+
"unicorn/prefer-minimal-ternary": "error",
|
|
1395
|
+
|
|
960
1396
|
// Not here, define only for `browsers`
|
|
961
1397
|
// "unicorn/prefer-modern-dom-apis": "error",
|
|
962
1398
|
|
|
963
1399
|
"unicorn/prefer-modern-math-apis": "error",
|
|
964
1400
|
|
|
965
|
-
//
|
|
1401
|
+
// Only reports CommonJS, which we support
|
|
966
1402
|
// "unicorn/prefer-module": "off",
|
|
967
1403
|
|
|
968
1404
|
"unicorn/prefer-native-coercion-functions": "error",
|
|
@@ -973,41 +1409,108 @@ const unicornRules = {
|
|
|
973
1409
|
// We have `n/prefer-node-protocol` rule
|
|
974
1410
|
// "unicorn/prefer-node-protocol": "off",
|
|
975
1411
|
|
|
1412
|
+
// No need
|
|
1413
|
+
// "unicorn/prefer-number-coercion": "off",
|
|
1414
|
+
|
|
1415
|
+
"unicorn/prefer-number-is-safe-integer": "error",
|
|
1416
|
+
|
|
976
1417
|
"unicorn/prefer-number-properties": "error",
|
|
977
1418
|
|
|
1419
|
+
"unicorn/prefer-object-define-properties": "error",
|
|
1420
|
+
|
|
1421
|
+
"unicorn/prefer-object-destructuring-defaults": "error",
|
|
1422
|
+
|
|
978
1423
|
"unicorn/prefer-object-from-entries": "error",
|
|
979
1424
|
|
|
1425
|
+
// TODO enable in future
|
|
1426
|
+
// "unicorn/prefer-object-iterable-methods": "error",
|
|
1427
|
+
|
|
1428
|
+
// Not here, define only for `browsers`
|
|
1429
|
+
// "unicorn/prefer-observer-apis": "off",
|
|
1430
|
+
|
|
980
1431
|
"unicorn/prefer-optional-catch-binding": "error",
|
|
981
1432
|
|
|
1433
|
+
// TODO enable in future
|
|
1434
|
+
// "unicorn/prefer-options-parameter": "error",
|
|
1435
|
+
|
|
1436
|
+
// TODO enable in future
|
|
1437
|
+
// "unicorn/prefer-private-class-fields": "error",
|
|
1438
|
+
|
|
1439
|
+
"unicorn/prefer-promise-static-methods": "error",
|
|
1440
|
+
|
|
1441
|
+
// Disabled for ECMAScript < 2026: `Promise.try()` is ES2025, but Node.js 22, the
|
|
1442
|
+
// ES2025 row in `get-es-version-from-node.js`, doesn't have it (V8 12.4)
|
|
1443
|
+
"unicorn/prefer-promise-try": "error",
|
|
1444
|
+
|
|
1445
|
+
// Disabled for ECMAScript < 2024
|
|
1446
|
+
"unicorn/prefer-promise-with-resolvers": "error",
|
|
1447
|
+
|
|
982
1448
|
"unicorn/prefer-prototype-methods": "error",
|
|
983
1449
|
|
|
984
1450
|
// Not here, define only for `browsers`
|
|
985
1451
|
// "unicorn/prefer-query-selector": "error",
|
|
986
1452
|
|
|
1453
|
+
// TODO Enable in future
|
|
1454
|
+
// "unicorn/prefer-queue-microtask": "error",
|
|
1455
|
+
|
|
987
1456
|
// No need
|
|
988
|
-
|
|
1457
|
+
"unicorn/prefer-reflect-apply": "error",
|
|
1458
|
+
|
|
1459
|
+
"unicorn/prefer-regexp-escape": "error",
|
|
1460
|
+
|
|
1461
|
+
"unicorn/prefer-regexp-exec": "error",
|
|
989
1462
|
|
|
990
1463
|
"unicorn/prefer-regexp-test": "error",
|
|
991
1464
|
|
|
992
1465
|
"unicorn/prefer-response-static-json": "error",
|
|
993
1466
|
|
|
994
1467
|
// No need
|
|
1468
|
+
// "unicorn/prefer-scoped-selector": "off",
|
|
1469
|
+
|
|
1470
|
+
// TODO No need
|
|
995
1471
|
// "unicorn/prefer-set-has": "off",
|
|
996
1472
|
|
|
1473
|
+
"unicorn/prefer-set-methods": "error",
|
|
1474
|
+
|
|
1475
|
+
"unicorn/prefer-set-size": "error",
|
|
1476
|
+
|
|
997
1477
|
// No need
|
|
998
|
-
// "unicorn/prefer-
|
|
1478
|
+
// "unicorn/prefer-short-arrow-method": "off",
|
|
1479
|
+
|
|
1480
|
+
"unicorn/prefer-short-escape-sequences": "error",
|
|
999
1481
|
|
|
1000
1482
|
// TODO enable in the next major release
|
|
1001
1483
|
// "unicorn/prefer-simple-condition-first": "error",
|
|
1002
1484
|
|
|
1485
|
+
"unicorn/prefer-simple-sort-comparator": "error",
|
|
1486
|
+
|
|
1487
|
+
"unicorn/prefer-simplified-conditions": "error",
|
|
1488
|
+
|
|
1489
|
+
"unicorn/prefer-single-array-predicate": "error",
|
|
1490
|
+
|
|
1003
1491
|
// No need
|
|
1004
1492
|
// "unicorn/prefer-single-call": "off",
|
|
1005
1493
|
|
|
1494
|
+
"unicorn/prefer-single-object-destructuring": "error",
|
|
1495
|
+
|
|
1496
|
+
"unicorn/prefer-single-replace": "error",
|
|
1497
|
+
|
|
1498
|
+
"unicorn/prefer-smaller-scope": "error",
|
|
1499
|
+
|
|
1500
|
+
"unicorn/prefer-split-limit": "error",
|
|
1501
|
+
|
|
1006
1502
|
"unicorn/prefer-spread": "error",
|
|
1007
1503
|
|
|
1504
|
+
// TODO enable in future
|
|
1505
|
+
// "unicorn/prefer-string-match-all": "error",
|
|
1506
|
+
|
|
1507
|
+
"unicorn/prefer-string-pad-start-end": "error",
|
|
1508
|
+
|
|
1008
1509
|
// No need
|
|
1009
1510
|
// "unicorn/prefer-string-raw": "error"
|
|
1010
1511
|
|
|
1512
|
+
"unicorn/prefer-string-repeat": "error",
|
|
1513
|
+
|
|
1011
1514
|
"unicorn/prefer-string-replace-all": "error",
|
|
1012
1515
|
|
|
1013
1516
|
"unicorn/prefer-string-slice": "error",
|
|
@@ -1021,40 +1524,93 @@ const unicornRules = {
|
|
|
1021
1524
|
// No need
|
|
1022
1525
|
// "unicorn/prefer-switch": "error",
|
|
1023
1526
|
|
|
1024
|
-
|
|
1527
|
+
// TODO Enable in future
|
|
1528
|
+
// "unicorn/prefer-temporal": "error",
|
|
1025
1529
|
|
|
1026
|
-
|
|
1530
|
+
// TODO Enable in future
|
|
1531
|
+
// "unicorn/prefer-temporal-conversion": "error",
|
|
1532
|
+
|
|
1533
|
+
// TODO need better setup
|
|
1534
|
+
// "unicorn/prefer-ternary": ["error", "only-single-line"],
|
|
1535
|
+
|
|
1536
|
+
"unicorn/prefer-then-catch": "error",
|
|
1537
|
+
|
|
1538
|
+
// Not here, define only for `browsers`
|
|
1539
|
+
// "unicorn/prefer-toggle-attribute": "error",
|
|
1540
|
+
|
|
1541
|
+
// Only for ECMAScript modules, so enabled in `node/module`, `browser/recommended`
|
|
1542
|
+
// and `browser/recommended-outdated-module`: CommonJS and scripts can't use
|
|
1543
|
+
// top-level `await`, and the rule only skips `.cjs` files
|
|
1544
|
+
// "unicorn/prefer-top-level-await": "error",
|
|
1027
1545
|
|
|
1028
1546
|
// No need
|
|
1029
1547
|
// "unicorn/prefer-type-error": "error",
|
|
1030
1548
|
|
|
1031
|
-
//
|
|
1032
|
-
|
|
1549
|
+
// TODO Maybe move to typescript?
|
|
1550
|
+
"unicorn/prefer-type-literal-last": "error",
|
|
1551
|
+
|
|
1552
|
+
"unicorn/prefer-uint8array-base64": "error",
|
|
1553
|
+
|
|
1554
|
+
// TODO Enable in future
|
|
1555
|
+
// "unicorn/prefer-uint8array-hex": "error",
|
|
1556
|
+
|
|
1557
|
+
"unicorn/prefer-unary-minus": "error",
|
|
1558
|
+
|
|
1559
|
+
// TODO enable in future
|
|
1560
|
+
// "unicorn/prefer-unicode-code-point-escapes": "error",
|
|
1561
|
+
|
|
1562
|
+
// Disabled for ECMAScript < 2023 (Node.js 20, the first with `URL.canParse()` in all its releases)
|
|
1563
|
+
"unicorn/prefer-url-can-parse": "error",
|
|
1564
|
+
|
|
1565
|
+
"unicorn/prefer-url-href": "error",
|
|
1566
|
+
|
|
1567
|
+
"unicorn/prefer-url-search-parameters": "error",
|
|
1568
|
+
|
|
1569
|
+
"unicorn/prefer-while-loop-condition": "error",
|
|
1033
1570
|
|
|
1034
1571
|
"unicorn/relative-url-style": ["error", "always"],
|
|
1035
1572
|
|
|
1573
|
+
"unicorn/require-array-join-separator": "error",
|
|
1574
|
+
|
|
1575
|
+
// TODO enable in future
|
|
1576
|
+
"unicorn/require-array-sort-compare": "off",
|
|
1577
|
+
|
|
1578
|
+
// Not here, define only for `browsers`
|
|
1579
|
+
// "unicorn/require-css-escape": "error",
|
|
1580
|
+
|
|
1036
1581
|
// No need
|
|
1037
|
-
|
|
1582
|
+
"unicorn/require-frontmatter-fields": "off",
|
|
1038
1583
|
|
|
1039
1584
|
"unicorn/require-module-attributes": "error",
|
|
1040
1585
|
|
|
1041
1586
|
"unicorn/require-module-specifiers": "error",
|
|
1042
1587
|
|
|
1043
|
-
// No need
|
|
1044
|
-
|
|
1588
|
+
// No need extra characters
|
|
1589
|
+
"unicorn/require-number-to-fixed-digits-argument": "off",
|
|
1590
|
+
|
|
1591
|
+
// Not here, define only for `browsers`
|
|
1592
|
+
// "unicorn/require-passive-events": "error",
|
|
1045
1593
|
|
|
1046
1594
|
// No need
|
|
1047
1595
|
// "unicorn/require-post-message-target-origin": "error",
|
|
1048
1596
|
|
|
1597
|
+
"unicorn/require-proxy-trap-boolean-return": "error",
|
|
1598
|
+
|
|
1599
|
+
// We have prettier
|
|
1600
|
+
"unicorn/require-spread-parentheses": "off",
|
|
1601
|
+
|
|
1602
|
+
"unicorn/require-text-decoder-streaming": "error",
|
|
1603
|
+
|
|
1604
|
+
// TODO enable in future
|
|
1605
|
+
// "unicorn/single-line-block-comment-style": "error",
|
|
1606
|
+
|
|
1049
1607
|
// No need
|
|
1050
1608
|
// "unicorn/string-content": "off",
|
|
1051
1609
|
|
|
1052
|
-
//
|
|
1053
|
-
|
|
1610
|
+
// TODO enable in future
|
|
1611
|
+
"unicorn/switch-case-braces": "off",
|
|
1054
1612
|
|
|
1055
|
-
|
|
1056
|
-
// No need
|
|
1057
|
-
// "unicorn/switch-case-break-position": "off",
|
|
1613
|
+
"unicorn/switch-case-break-position": "error",
|
|
1058
1614
|
|
|
1059
1615
|
// No need
|
|
1060
1616
|
// "unicorn/template-indent": "off",
|
|
@@ -1062,6 +1618,9 @@ const unicornRules = {
|
|
|
1062
1618
|
"unicorn/text-encoding-identifier-case": "error",
|
|
1063
1619
|
|
|
1064
1620
|
"unicorn/throw-new-error": "error",
|
|
1621
|
+
|
|
1622
|
+
// No need
|
|
1623
|
+
"unicorn/try-complexity": "off",
|
|
1065
1624
|
};
|
|
1066
1625
|
|
|
1067
1626
|
/** @type {import("eslint").Linter.Config["rules"]} */
|
|
@@ -1069,135 +1628,144 @@ const importRules = {
|
|
|
1069
1628
|
...importPlugin.flatConfigs.recommended.rules,
|
|
1070
1629
|
|
|
1071
1630
|
// From recommended
|
|
1072
|
-
// "import/export": "error",
|
|
1631
|
+
// "import-x/export": "error",
|
|
1073
1632
|
|
|
1074
1633
|
// No need
|
|
1075
|
-
// "import/no-deprecated": "off",
|
|
1634
|
+
// "import-x/no-deprecated": "off",
|
|
1076
1635
|
|
|
1077
1636
|
// No need, we have `unicorn/require-module-specifiers`
|
|
1078
|
-
// "import/no-empty-named-blocks": "off",
|
|
1637
|
+
// "import-x/no-empty-named-blocks": "off",
|
|
1079
1638
|
|
|
1080
|
-
"import/no-extraneous-dependencies": "error",
|
|
1639
|
+
"import-x/no-extraneous-dependencies": "error",
|
|
1081
1640
|
|
|
1082
|
-
"import/no-mutable-exports": "error",
|
|
1641
|
+
"import-x/no-mutable-exports": "error",
|
|
1083
1642
|
|
|
1084
|
-
"import/no-named-as-default": "error",
|
|
1643
|
+
"import-x/no-named-as-default": "error",
|
|
1085
1644
|
|
|
1086
|
-
|
|
1645
|
+
// No need
|
|
1646
|
+
// "import-x/no-named-as-default-member": "off",
|
|
1087
1647
|
|
|
1088
1648
|
// No need
|
|
1089
|
-
// "import/no-
|
|
1649
|
+
// "import-x/no-rename-default": "error",
|
|
1090
1650
|
|
|
1091
|
-
|
|
1651
|
+
// No need
|
|
1652
|
+
// "import-x/no-unused-modules": "error",
|
|
1653
|
+
|
|
1654
|
+
"import-x/no-amd": "error",
|
|
1092
1655
|
|
|
1093
1656
|
// No need
|
|
1094
|
-
// "import/no-commonjs": "off",
|
|
1657
|
+
// "import-x/no-commonjs": "off",
|
|
1095
1658
|
|
|
1096
1659
|
// No need
|
|
1097
|
-
// "import/no-import-module-exports": "off",
|
|
1660
|
+
// "import-x/no-import-module-exports": "off",
|
|
1098
1661
|
|
|
1099
1662
|
// No need
|
|
1100
|
-
// "import/no-nodejs-modules": "off",
|
|
1663
|
+
// "import-x/no-nodejs-modules": "off",
|
|
1101
1664
|
|
|
1102
1665
|
// No need
|
|
1103
|
-
// "import/unambiguous": "off",
|
|
1666
|
+
// "import-x/unambiguous": "off",
|
|
1104
1667
|
|
|
1105
|
-
//
|
|
1106
|
-
// "import/
|
|
1668
|
+
// No need
|
|
1669
|
+
// "import-x/avoid-barrel-files": "off",
|
|
1107
1670
|
|
|
1108
1671
|
// No need
|
|
1109
|
-
//
|
|
1110
|
-
// "enforce-node-protocol-usage": "off",
|
|
1672
|
+
// "import-x/avoid-importing-barrel-files": "off",
|
|
1111
1673
|
|
|
1112
1674
|
// No need
|
|
1113
|
-
// "import/
|
|
1675
|
+
// "import-x/avoid-namespace-import": "off",
|
|
1676
|
+
|
|
1677
|
+
// No need
|
|
1678
|
+
// "import-x/avoid-re-export-all": "off",
|
|
1114
1679
|
|
|
1115
1680
|
// From recommended
|
|
1116
|
-
// "import/
|
|
1681
|
+
// "import-x/default": "error",
|
|
1117
1682
|
|
|
1118
1683
|
// From recommended
|
|
1119
|
-
// "import/
|
|
1684
|
+
// "import-x/named": "error",
|
|
1120
1685
|
|
|
1121
|
-
|
|
1686
|
+
// From recommended
|
|
1687
|
+
// "import-x/namespace": "error",
|
|
1688
|
+
|
|
1689
|
+
"import-x/no-absolute-path": "error",
|
|
1122
1690
|
|
|
1123
1691
|
// No need
|
|
1124
|
-
// "import/no-cycle": "off",
|
|
1692
|
+
// "import-x/no-cycle": "off",
|
|
1125
1693
|
|
|
1126
1694
|
// No need
|
|
1127
|
-
// "import/no-dynamic-require": "off",
|
|
1695
|
+
// "import-x/no-dynamic-require": "off",
|
|
1128
1696
|
|
|
1129
1697
|
// No need
|
|
1130
|
-
// "import/no-internal-modules": "off",
|
|
1698
|
+
// "import-x/no-internal-modules": "off",
|
|
1131
1699
|
|
|
1132
1700
|
// No need
|
|
1133
|
-
// "import/no-relative-packages": "off",
|
|
1701
|
+
// "import-x/no-relative-packages": "off",
|
|
1134
1702
|
|
|
1135
1703
|
// No need
|
|
1136
|
-
// "import/no-relative-parent-imports": "off",
|
|
1704
|
+
// "import-x/no-relative-parent-imports": "off",
|
|
1137
1705
|
|
|
1138
1706
|
// No need
|
|
1139
|
-
// "import/no-restricted-paths": "off",
|
|
1707
|
+
// "import-x/no-restricted-paths": "off",
|
|
1140
1708
|
|
|
1141
|
-
"import/no-self-import": "error",
|
|
1709
|
+
"import-x/no-self-import": "error",
|
|
1142
1710
|
|
|
1143
1711
|
// From recommended
|
|
1144
|
-
"import/no-unresolved": [
|
|
1712
|
+
"import-x/no-unresolved": [
|
|
1145
1713
|
"error",
|
|
1146
1714
|
{ ignore: ["^eslint/config$", "^typescript-eslint$"], commonjs: true },
|
|
1147
1715
|
],
|
|
1148
1716
|
|
|
1149
1717
|
// No need
|
|
1150
|
-
// "import/no-useless-path-segments": "off",
|
|
1718
|
+
// "import-x/no-useless-path-segments": "off",
|
|
1151
1719
|
|
|
1152
1720
|
// No need
|
|
1153
|
-
// "import/no-webpack-loader-syntax": "off",
|
|
1721
|
+
// "import-x/no-webpack-loader-syntax": "off",
|
|
1154
1722
|
|
|
1155
|
-
"import/consistent-type-specifier-style": ["error", "prefer-inline"],
|
|
1723
|
+
"import-x/consistent-type-specifier-style": ["error", "prefer-inline"],
|
|
1156
1724
|
|
|
1157
1725
|
// No need
|
|
1158
|
-
// "import/dynamic-import-chunkname": "off",
|
|
1726
|
+
// "import-x/dynamic-import-chunkname": "off",
|
|
1159
1727
|
|
|
1160
1728
|
// No need
|
|
1161
|
-
// "import/exports-last": "off",
|
|
1729
|
+
// "import-x/exports-last": "off",
|
|
1162
1730
|
|
|
1163
1731
|
// Not here
|
|
1164
|
-
// "import/extensions": ["error", "always", { ignorePackages: true }],
|
|
1732
|
+
// "import-x/extensions": ["error", "always", { ignorePackages: true }],
|
|
1165
1733
|
|
|
1166
|
-
"import/first": "error",
|
|
1734
|
+
"import-x/first": "error",
|
|
1167
1735
|
|
|
1168
1736
|
// No need
|
|
1169
|
-
// "import/group-exports": "off",
|
|
1737
|
+
// "import-x/group-exports": "off",
|
|
1170
1738
|
|
|
1171
1739
|
// No need
|
|
1172
|
-
// "import/max-dependencies": "off",
|
|
1740
|
+
// "import-x/max-dependencies": "off",
|
|
1173
1741
|
|
|
1174
1742
|
// No need
|
|
1175
1743
|
// We have `@stylistic/padding-line-between-statements`
|
|
1176
|
-
// "import/newline-after-import": "off",
|
|
1744
|
+
// "import-x/newline-after-import": "off",
|
|
1177
1745
|
|
|
1178
1746
|
// No need
|
|
1179
|
-
// "import/no-anonymous-default-export": "off",
|
|
1747
|
+
// "import-x/no-anonymous-default-export": "off",
|
|
1180
1748
|
|
|
1181
1749
|
// No need
|
|
1182
|
-
// "import/no-default-export": "off",
|
|
1750
|
+
// "import-x/no-default-export": "off",
|
|
1183
1751
|
|
|
1184
1752
|
// No need
|
|
1185
1753
|
// We have `no-duplicate-imports` rule
|
|
1186
|
-
"import/no-duplicates": "off",
|
|
1754
|
+
"import-x/no-duplicates": "off",
|
|
1187
1755
|
|
|
1188
1756
|
// No need
|
|
1189
|
-
// "import/no-named-default": "off",
|
|
1757
|
+
// "import-x/no-named-default": "off",
|
|
1190
1758
|
|
|
1191
1759
|
// No need
|
|
1192
|
-
// "import/no-named-export": "off",
|
|
1760
|
+
// "import-x/no-named-export": "off",
|
|
1193
1761
|
|
|
1194
1762
|
// No need
|
|
1195
|
-
// "import/no-namespace": "off",
|
|
1763
|
+
// "import-x/no-namespace": "off",
|
|
1196
1764
|
|
|
1197
1765
|
// No need
|
|
1198
|
-
// "import/no-unassigned-import": "off",
|
|
1766
|
+
// "import-x/no-unassigned-import": "off",
|
|
1199
1767
|
|
|
1200
|
-
"import/order": [
|
|
1768
|
+
"import-x/order": [
|
|
1201
1769
|
"error",
|
|
1202
1770
|
{
|
|
1203
1771
|
named: {
|
|
@@ -1213,7 +1781,10 @@ const importRules = {
|
|
|
1213
1781
|
],
|
|
1214
1782
|
|
|
1215
1783
|
// No need
|
|
1216
|
-
// "import/prefer-default-export": "off",
|
|
1784
|
+
// "import-x/prefer-default-export": "off",
|
|
1785
|
+
|
|
1786
|
+
// No need
|
|
1787
|
+
// "import-x/prefer-namespace-import": "off",
|
|
1217
1788
|
};
|
|
1218
1789
|
|
|
1219
1790
|
const needTypescriptSupport = isTypescriptInstalled();
|
|
@@ -1225,12 +1796,12 @@ const baseConfig = {
|
|
|
1225
1796
|
files: [`**/*.{${extensions.map((item) => item.slice(1)).join(",")}}`],
|
|
1226
1797
|
ignores: ["**/*.d.ts"],
|
|
1227
1798
|
settings: {
|
|
1228
|
-
"import/extensions": extensions,
|
|
1229
|
-
"import/ignore": [
|
|
1799
|
+
"import-x/extensions": extensions,
|
|
1800
|
+
"import-x/ignore": [
|
|
1230
1801
|
"eslint-plugin-.*",
|
|
1231
1802
|
"\\.(coffee|scss|css|less|hbs|svg|md|jpg|jpeg|png|gif|webp|avif)$",
|
|
1232
1803
|
],
|
|
1233
|
-
"import/resolver": {
|
|
1804
|
+
"import-x/resolver": {
|
|
1234
1805
|
node: {
|
|
1235
1806
|
extensions: [...extensions],
|
|
1236
1807
|
},
|
|
@@ -1238,7 +1809,7 @@ const baseConfig = {
|
|
|
1238
1809
|
},
|
|
1239
1810
|
plugins: {
|
|
1240
1811
|
unicorn: unicornPlugin,
|
|
1241
|
-
import: importPlugin,
|
|
1812
|
+
"import-x": importPlugin,
|
|
1242
1813
|
},
|
|
1243
1814
|
linterOptions: {
|
|
1244
1815
|
reportUnusedDisableDirectives: "error",
|
|
@@ -1290,7 +1861,7 @@ function getConfig(esVersion) {
|
|
|
1290
1861
|
config.rules["no-template-curly-in-string"] = "off";
|
|
1291
1862
|
config.rules["unicorn/prefer-spread"] = "off";
|
|
1292
1863
|
config.rules["unicorn/prefer-includes"] = "off";
|
|
1293
|
-
config.rules["unicorn/no-
|
|
1864
|
+
config.rules["unicorn/no-for-each"] = "off";
|
|
1294
1865
|
}
|
|
1295
1866
|
|
|
1296
1867
|
if (esVersion < 2018) {
|
|
@@ -1320,12 +1891,36 @@ function getConfig(esVersion) {
|
|
|
1320
1891
|
if (esVersion < 2022) {
|
|
1321
1892
|
config.rules["prefer-object-has-own"] = "off";
|
|
1322
1893
|
config.rules["unicorn/prefer-structured-clone"] = "off";
|
|
1323
|
-
config.rules["unicorn/prefer-top-level-await"] = "off";
|
|
1324
1894
|
config.rules["unicorn/prefer-class-fields"] = "off";
|
|
1895
|
+
config.rules["unicorn/prefer-at"] = "off";
|
|
1325
1896
|
}
|
|
1326
1897
|
|
|
1327
1898
|
if (esVersion < 2023) {
|
|
1328
1899
|
config.rules["unicorn/no-array-sort"] = "off";
|
|
1900
|
+
// `URL.canParse()` isn't ECMAScript, but every Node.js 20 release has it,
|
|
1901
|
+
// and Node.js 20 is the first ES2023 row in `get-es-version-from-node.js`
|
|
1902
|
+
config.rules["unicorn/prefer-url-can-parse"] = "off";
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
if (esVersion < 2024) {
|
|
1906
|
+
config.rules["unicorn/prefer-group-by"] = "off";
|
|
1907
|
+
config.rules["unicorn/prefer-promise-with-resolvers"] = "off";
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
if (esVersion < 2025) {
|
|
1911
|
+
config.rules["unicorn/prefer-iterator-helpers"] = "off";
|
|
1912
|
+
config.rules["unicorn/prefer-iterator-to-array"] = "off";
|
|
1913
|
+
config.rules["unicorn/prefer-iterator-to-array-at-end"] = "off";
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
// `RegExp.escape()` is an ES2026 API (Node.js 24+), the parser setting alone
|
|
1917
|
+
// doesn't guarantee its availability at runtime, so the autofix would break older targets
|
|
1918
|
+
if (esVersion < 2026) {
|
|
1919
|
+
config.rules["unicorn/prefer-regexp-escape"] = "off";
|
|
1920
|
+
config.rules["unicorn/prefer-promise-try"] = "off";
|
|
1921
|
+
config.rules["unicorn/prefer-error-is-error"] = "off";
|
|
1922
|
+
config.rules["unicorn/prefer-uint8array-base64"] = "off";
|
|
1923
|
+
config.rules["unicorn/prefer-get-or-insert-computed"] = "off";
|
|
1329
1924
|
}
|
|
1330
1925
|
|
|
1331
1926
|
return config;
|