@bhsd/code-standard 3.1.0 → 3.3.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.
Files changed (2) hide show
  1. package/eslint.js +269 -153
  2. package/package.json +12 -12
package/eslint.js CHANGED
@@ -14,6 +14,17 @@ import globals from 'globals';
14
14
 
15
15
  const tsRecommended = typescriptEslint.configs['flat/recommended-type-checked'],
16
16
  files = ['**/*.ts'];
17
+ const off = (rules, ruleNames) => {
18
+ const newRules = {...rules};
19
+ for (const ruleName of ruleNames) {
20
+ const name = `es-x/${ruleName}`;
21
+ if (!(name in newRules)) {
22
+ throw new RangeError(`Rule ${name} does not exist!`);
23
+ }
24
+ delete newRules[name];
25
+ }
26
+ return newRules;
27
+ };
17
28
  const getConfig = (rules, ecmaVersion) => ({
18
29
  languageOptions: {
19
30
  globals: globals.browser,
@@ -42,10 +53,238 @@ export const ignores = {
42
53
  '**/build/',
43
54
  ],
44
55
  },
56
+ unicornConfigs = {
57
+ plugins: {unicorn},
58
+ rules: {
59
+ 'unicorn/catch-error-name': [
60
+ 2,
61
+ {
62
+ name: 'e',
63
+ },
64
+ ],
65
+ 'unicorn/class-reference-in-static-methods': 2,
66
+ 'unicorn/consistent-assert': 2,
67
+ 'unicorn/consistent-conditional-object-spread': 2,
68
+ 'unicorn/consistent-date-clone': 2,
69
+ 'unicorn/consistent-empty-array-spread': 2,
70
+ 'unicorn/consistent-existence-index-check': 2,
71
+ 'unicorn/consistent-export-decorator-position': 2,
72
+ 'unicorn/consistent-function-scoping': [
73
+ 2,
74
+ {
75
+ checkArrowFunctions: false,
76
+ },
77
+ ],
78
+ 'unicorn/consistent-template-literal-escape': 2,
79
+ 'unicorn/default-export-style': 2,
80
+ 'unicorn/empty-brace-spaces': 2,
81
+ 'unicorn/error-message': 2,
82
+ 'unicorn/explicit-length-check': 2,
83
+ 'unicorn/explicit-timer-delay': 2,
84
+ 'unicorn/new-for-builtins': 2,
85
+ 'unicorn/no-abusive-eslint-disable': 2,
86
+ 'unicorn/no-accessor-recursion': 2,
87
+ 'unicorn/no-array-callback-reference': 2,
88
+ 'unicorn/no-array-fill-with-reference-type': 2,
89
+ 'unicorn/no-boolean-sort-comparator': 2,
90
+ 'unicorn/no-for-each': 2,
91
+ 'unicorn/no-array-from-fill': 2,
92
+ 'unicorn/no-array-method-this-argument': 2,
93
+ 'unicorn/no-array-reduce': 2,
94
+ 'unicorn/no-await-in-promise-methods': 2,
95
+ 'unicorn/no-chained-comparison': 2,
96
+ 'unicorn/no-confusing-array-splice': 2,
97
+ 'unicorn/no-constant-zero-expression': 2,
98
+ 'unicorn/no-declarations-before-early-exit': 2,
99
+ 'unicorn/no-double-comparison': 2,
100
+ 'unicorn/no-duplicate-if-branches': 2,
101
+ 'unicorn/no-duplicate-logical-operands': 2,
102
+ 'unicorn/no-duplicate-loops': 2,
103
+ 'unicorn/no-duplicate-set-values': 2,
104
+ 'unicorn/no-exports-in-scripts': 2,
105
+ 'unicorn/no-immediate-mutation': 2,
106
+ 'unicorn/no-incorrect-query-selector': 2,
107
+ 'unicorn/no-incorrect-template-string-interpolation': 2,
108
+ 'unicorn/no-instanceof-builtins': 2,
109
+ 'unicorn/no-invalid-character-comparison': 2,
110
+ 'unicorn/no-invalid-fetch-options': 2,
111
+ 'unicorn/no-invalid-remove-event-listener': 2,
112
+ 'unicorn/no-invalid-well-known-symbol-methods': 2,
113
+ 'unicorn/no-late-current-target-access': 2,
114
+ 'unicorn/no-late-event-control': 2,
115
+ 'unicorn/no-lonely-if': 2,
116
+ 'unicorn/no-loop-iterable-mutation': 2,
117
+ 'unicorn/no-mismatched-map-key': 2,
118
+ 'unicorn/no-misrefactored-assignment': 2,
119
+ 'unicorn/no-named-default': 2,
120
+ 'unicorn/no-negated-comparison': [
121
+ 2,
122
+ {
123
+ checkLogicalExpressions: true,
124
+ },
125
+ ],
126
+ 'unicorn/no-negated-condition': 2,
127
+ 'unicorn/no-negation-in-equality-check': 2,
128
+ 'unicorn/no-new-array': 2,
129
+ 'unicorn/no-object-as-default-parameter': 2,
130
+ 'unicorn/no-object-methods-with-collections': 2,
131
+ 'unicorn/no-redundant-comparison': 2,
132
+ 'unicorn/no-return-array-push': 2,
133
+ 'unicorn/no-selector-as-dom-name': 2,
134
+ 'unicorn/no-single-promise-in-promise-methods': 2,
135
+ 'unicorn/no-static-only-class': 2,
136
+ 'unicorn/no-subtraction-comparison': 2,
137
+ 'unicorn/no-this-assignment': 2,
138
+ 'unicorn/no-top-level-side-effects': 2,
139
+ 'unicorn/no-typeof-undefined': 2,
140
+ 'unicorn/no-uncalled-method': 2,
141
+ 'unicorn/no-undeclared-class-members': 2,
142
+ 'unicorn/no-unnecessary-array-flat-depth': 2,
143
+ 'unicorn/no-unnecessary-array-splice-count': 2,
144
+ 'unicorn/no-unnecessary-await': 2,
145
+ 'unicorn/no-unnecessary-boolean-comparison': 2,
146
+ 'unicorn/no-unnecessary-fetch-options': 2,
147
+ 'unicorn/no-unnecessary-global-this': 2,
148
+ 'unicorn/no-unnecessary-splice': 2,
149
+ 'unicorn/no-unsafe-buffer-conversion': 2,
150
+ 'unicorn/no-unsafe-promise-all-settled-values': 2,
151
+ 'unicorn/no-unsafe-string-replacement': 2,
152
+ 'unicorn/no-unused-array-method-return': 2,
153
+ 'unicorn/no-unused-properties': 2,
154
+ 'unicorn/no-useless-boolean-cast': 2,
155
+ 'unicorn/no-useless-coercion': 2,
156
+ 'unicorn/no-useless-collection-argument': 2,
157
+ 'unicorn/no-useless-compound-assignment': 2,
158
+ 'unicorn/no-useless-concat': 2,
159
+ 'unicorn/no-useless-continue': 2,
160
+ 'unicorn/no-useless-delete-check': 2,
161
+ 'unicorn/no-useless-fallback-in-spread': 2,
162
+ 'unicorn/no-useless-length-check': 2,
163
+ 'unicorn/no-useless-logical-operand': 2,
164
+ 'unicorn/no-useless-override': 2,
165
+ 'unicorn/no-useless-promise-resolve-reject': 2,
166
+ 'unicorn/no-useless-recursion': 2,
167
+ 'unicorn/no-useless-spread': 2,
168
+ 'unicorn/no-useless-switch-case': 2,
169
+ 'unicorn/no-useless-template-literals': 2,
170
+ 'unicorn/number-literal-case': 2,
171
+ 'unicorn/numeric-separators-style': 2,
172
+ 'unicorn/operator-assignment': 2,
173
+ 'unicorn/prefer-add-event-listener-options': 2,
174
+ 'unicorn/prefer-array-find': 2,
175
+ 'unicorn/prefer-array-flat': 2,
176
+ 'unicorn/prefer-array-flat-map': 2,
177
+ 'unicorn/prefer-array-from-map': 2,
178
+ 'unicorn/prefer-array-index-of': 2,
179
+ 'unicorn/prefer-array-iterable-methods': 2,
180
+ 'unicorn/prefer-array-last-methods': 2,
181
+ 'unicorn/prefer-array-some': 2,
182
+ 'unicorn/prefer-at': 2,
183
+ 'unicorn/prefer-await': 2,
184
+ 'unicorn/prefer-bigint-literals': 2,
185
+ 'unicorn/prefer-block-statement-over-iife': 2,
186
+ 'unicorn/prefer-boolean-return': 2,
187
+ 'unicorn/prefer-class-fields': 2,
188
+ 'unicorn/prefer-classlist-toggle': 2,
189
+ 'unicorn/prefer-code-point': 2,
190
+ 'unicorn/prefer-continue': [
191
+ 2,
192
+ {
193
+ maximumStatements: 2,
194
+ },
195
+ ],
196
+ 'unicorn/prefer-default-parameters': 2,
197
+ 'unicorn/prefer-direct-iteration': 2,
198
+ 'unicorn/prefer-dispose': 2,
199
+ 'unicorn/prefer-else-if': 2,
200
+ 'unicorn/prefer-export-from': [
201
+ 2,
202
+ {
203
+ checkUsedVariables: false,
204
+ },
205
+ ],
206
+ 'unicorn/prefer-flat-math-min-max': 2,
207
+ 'unicorn/prefer-global-this': 2,
208
+ 'unicorn/prefer-has-check': 2,
209
+ 'unicorn/prefer-hoisting-branch-code': 2,
210
+ 'unicorn/prefer-import-meta-properties': 2,
211
+ 'unicorn/prefer-includes': 2,
212
+ 'unicorn/prefer-includes-over-repeated-comparisons': 2,
213
+ 'unicorn/prefer-iterable-in-constructor': 2,
214
+ 'unicorn/prefer-keyboard-event-key': 2,
215
+ 'unicorn/prefer-location-assign': 2,
216
+ 'unicorn/prefer-logical-operator-over-ternary': 2,
217
+ 'unicorn/prefer-map-from-entries': 2,
218
+ 'unicorn/prefer-math-abs': 2,
219
+ 'unicorn/prefer-math-constants': 2,
220
+ 'unicorn/prefer-math-min-max': 2,
221
+ 'unicorn/prefer-minimal-ternary': [
222
+ 2,
223
+ {
224
+ checkVaryingBase: true,
225
+ checkComputedMemberAccess: true,
226
+ },
227
+ ],
228
+ 'unicorn/prefer-native-coercion-functions': 2,
229
+ 'unicorn/prefer-negative-index': 2,
230
+ 'unicorn/prefer-number-is-safe-integer': 2,
231
+ 'unicorn/prefer-object-define-properties': 2,
232
+ 'unicorn/prefer-object-destructuring-defaults': 2,
233
+ 'unicorn/prefer-object-from-entries': 2,
234
+ 'unicorn/prefer-object-iterable-methods': 2,
235
+ 'unicorn/prefer-optional-catch-binding': 2,
236
+ 'unicorn/prefer-private-class-fields': 2,
237
+ 'unicorn/prefer-prototype-methods': 2,
238
+ 'unicorn/prefer-reflect-apply': 2,
239
+ 'unicorn/prefer-regexp-test': 2,
240
+ 'unicorn/prefer-simple-condition-first': 2,
241
+ 'unicorn/prefer-simple-sort-comparator': 2,
242
+ 'unicorn/prefer-simplified-conditions': 2,
243
+ 'unicorn/prefer-single-array-predicate': 2,
244
+ 'unicorn/prefer-single-call': 2,
245
+ 'unicorn/prefer-single-object-destructuring': 2,
246
+ 'unicorn/prefer-single-replace': 2,
247
+ 'unicorn/prefer-smaller-scope': 2,
248
+ 'unicorn/prefer-split-limit': 2,
249
+ 'unicorn/prefer-spread': 2,
250
+ 'unicorn/prefer-string-pad-start-end': 2,
251
+ 'unicorn/prefer-string-raw': 2,
252
+ 'unicorn/prefer-string-repeat': 2,
253
+ 'unicorn/prefer-string-replace-all': 2,
254
+ 'unicorn/prefer-string-starts-ends-with': 2,
255
+ 'unicorn/prefer-switch': 2,
256
+ 'unicorn/prefer-ternary': 2,
257
+ 'unicorn/prefer-toggle-attribute': 2,
258
+ 'unicorn/prefer-uint8array-base64': 2,
259
+ 'unicorn/prefer-url-href': 2,
260
+ 'unicorn/prefer-url-search-parameters': 2,
261
+ 'unicorn/prefer-while-loop-condition': 2,
262
+ 'unicorn/require-css-escape': 2,
263
+ 'unicorn/require-module-attributes': 2,
264
+ 'unicorn/require-array-sort-compare': 2,
265
+ 'unicorn/require-number-to-fixed-digits-argument': 2,
266
+ 'unicorn/require-passive-events': 2,
267
+ 'unicorn/require-proxy-trap-boolean-return': 2,
268
+ 'unicorn/switch-case-braces': [
269
+ 2,
270
+ 'avoid',
271
+ ],
272
+ 'unicorn/switch-case-break-position': 2,
273
+ 'unicorn/text-encoding-identifier-case': 2,
274
+ 'unicorn/throw-new-error': 2,
275
+ },
276
+ },
277
+ unicornForNode = {
278
+ 'unicorn/no-array-reverse': 2,
279
+ 'unicorn/no-array-sort': 2,
280
+ 'unicorn/no-array-splice': 2,
281
+ 'unicorn/prefer-structured-clone': 2,
282
+ },
45
283
  general = [
46
284
  js.configs.recommended,
47
285
  promise.configs['flat/recommended'],
48
286
  regexp.configs['flat/recommended'],
287
+ unicornConfigs,
49
288
  {
50
289
  languageOptions: {
51
290
  ecmaVersion: 'latest',
@@ -271,7 +510,6 @@ export const ignores = {
271
510
  },
272
511
  ],
273
512
  'object-shorthand': 2,
274
- 'operator-assignment': 2,
275
513
  'prefer-arrow-callback': 2,
276
514
  'prefer-const': 2,
277
515
  'prefer-destructuring': [
@@ -556,131 +794,6 @@ export const ignores = {
556
794
  ],
557
795
  },
558
796
  },
559
- {
560
- plugins: {unicorn},
561
- rules: {
562
- 'unicorn/catch-error-name': [
563
- 2,
564
- {
565
- name: 'e',
566
- },
567
- ],
568
- 'unicorn/consistent-assert': 2,
569
- 'unicorn/consistent-date-clone': 2,
570
- 'unicorn/consistent-empty-array-spread': 2,
571
- 'unicorn/consistent-existence-index-check': 2,
572
- 'unicorn/consistent-function-scoping': [
573
- 2,
574
- {
575
- checkArrowFunctions: false,
576
- },
577
- ],
578
- 'unicorn/consistent-template-literal-escape': 2,
579
- 'unicorn/empty-brace-spaces': 2,
580
- 'unicorn/error-message': 2,
581
- 'unicorn/explicit-length-check': 2,
582
- 'unicorn/new-for-builtins': 2,
583
- 'unicorn/no-abusive-eslint-disable': 2,
584
- 'unicorn/no-accessor-recursion': 2,
585
- 'unicorn/no-array-callback-reference': 2,
586
- 'unicorn/no-array-fill-with-reference-type': 2,
587
- 'unicorn/no-array-for-each': 2,
588
- 'unicorn/no-array-from-fill': 2,
589
- 'unicorn/no-array-method-this-argument': 2,
590
- 'unicorn/no-array-reduce': 2,
591
- 'unicorn/no-await-in-promise-methods': 2,
592
- 'unicorn/no-confusing-array-splice': 2,
593
- 'unicorn/no-duplicate-set-values': 2,
594
- 'unicorn/no-exports-in-scripts': 2,
595
- 'unicorn/no-immediate-mutation': 2,
596
- 'unicorn/no-incorrect-query-selector': 2,
597
- 'unicorn/no-instanceof-builtins': 2,
598
- 'unicorn/no-invalid-fetch-options': 2,
599
- 'unicorn/no-invalid-remove-event-listener': 2,
600
- 'unicorn/no-late-current-target-access': 2,
601
- 'unicorn/no-lonely-if': 2,
602
- 'unicorn/no-named-default': 2,
603
- 'unicorn/no-negated-condition': 2,
604
- 'unicorn/no-negation-in-equality-check': 2,
605
- 'unicorn/no-nested-ternary': 2,
606
- 'unicorn/no-new-array': 2,
607
- 'unicorn/no-object-as-default-parameter': 2,
608
- 'unicorn/no-single-promise-in-promise-methods': 2,
609
- 'unicorn/no-static-only-class': 2,
610
- 'unicorn/no-this-assignment': 2,
611
- 'unicorn/no-typeof-undefined': 2,
612
- 'unicorn/no-unnecessary-array-flat-depth': 2,
613
- 'unicorn/no-unnecessary-array-splice-count': 2,
614
- 'unicorn/no-unnecessary-await': 2,
615
- 'unicorn/no-unreadable-iife': 2,
616
- 'unicorn/no-unused-array-method-return': 2,
617
- 'unicorn/no-unused-properties': 2,
618
- 'unicorn/no-useless-collection-argument': 2,
619
- 'unicorn/no-useless-fallback-in-spread': 2,
620
- 'unicorn/no-useless-length-check': 2,
621
- 'unicorn/no-useless-promise-resolve-reject': 2,
622
- 'unicorn/no-useless-spread': 2,
623
- 'unicorn/no-useless-switch-case': 2,
624
- 'unicorn/number-literal-case': 2,
625
- 'unicorn/numeric-separators-style': 2,
626
- 'unicorn/prefer-array-find': 2,
627
- 'unicorn/prefer-array-flat': 2,
628
- 'unicorn/prefer-array-flat-map': 2,
629
- 'unicorn/prefer-array-index-of': 2,
630
- 'unicorn/prefer-array-last-methods': 2,
631
- 'unicorn/prefer-array-some': 2,
632
- 'unicorn/prefer-at': 2,
633
- 'unicorn/prefer-bigint-literals': 2,
634
- 'unicorn/prefer-class-fields': 2,
635
- 'unicorn/prefer-classlist-toggle': 2,
636
- 'unicorn/prefer-code-point': 2,
637
- 'unicorn/prefer-default-parameters': 2,
638
- 'unicorn/prefer-export-from': [
639
- 2,
640
- {
641
- checkUsedVariables: false,
642
- },
643
- ],
644
- 'unicorn/prefer-global-this': 2,
645
- 'unicorn/prefer-import-meta-properties': 2,
646
- 'unicorn/prefer-includes': 2,
647
- 'unicorn/prefer-includes-over-repeated-comparisons': 2,
648
- 'unicorn/prefer-keyboard-event-key': 2,
649
- 'unicorn/prefer-logical-operator-over-ternary': 2,
650
- 'unicorn/prefer-math-abs': 2,
651
- 'unicorn/prefer-math-min-max': 2,
652
- 'unicorn/prefer-native-coercion-functions': 2,
653
- 'unicorn/prefer-negative-index': 2,
654
- 'unicorn/prefer-object-from-entries': 2,
655
- 'unicorn/prefer-optional-catch-binding': 2,
656
- 'unicorn/prefer-prototype-methods': 2,
657
- 'unicorn/prefer-reflect-apply': 2,
658
- 'unicorn/prefer-regexp-test': 2,
659
- 'unicorn/prefer-simple-condition-first': 2,
660
- 'unicorn/prefer-single-call': 2,
661
- 'unicorn/prefer-split-limit': 2,
662
- 'unicorn/prefer-spread': 2,
663
- 'unicorn/prefer-string-pad-start-end': 2,
664
- 'unicorn/prefer-string-raw': 2,
665
- 'unicorn/prefer-string-repeat': 2,
666
- 'unicorn/prefer-string-replace-all': 2,
667
- 'unicorn/prefer-string-starts-ends-with': 2,
668
- 'unicorn/prefer-structured-clone': 2,
669
- 'unicorn/prefer-switch': 2,
670
- 'unicorn/prefer-ternary': 2,
671
- 'unicorn/require-css-escape': 2,
672
- 'unicorn/require-module-attributes': 2,
673
- 'unicorn/require-number-to-fixed-digits-argument': 2,
674
- 'unicorn/require-passive-events': 2,
675
- 'unicorn/switch-case-braces': [
676
- 2,
677
- 'avoid',
678
- ],
679
- 'unicorn/switch-case-break-position': 2,
680
- 'unicorn/text-encoding-identifier-case': 2,
681
- 'unicorn/throw-new-error': 2,
682
- },
683
- },
684
797
  {
685
798
  plugins: {'@eslint-community/eslint-comments': eslintComments},
686
799
  rules: {
@@ -772,11 +885,13 @@ export const ignores = {
772
885
  },
773
886
  },
774
887
  },
888
+ noUnicorn = Object.fromEntries(Object.keys({...unicornConfigs.rules, ...unicornForNode}).map(rule => [rule, 0])),
775
889
  json = [
776
890
  ...jsonc.configs['recommended-with-json'],
777
891
  {
778
892
  files: ['**/*.json'],
779
893
  rules: {
894
+ ...noUnicorn,
780
895
  'jsonc/array-bracket-newline': [
781
896
  2,
782
897
  {
@@ -817,6 +932,7 @@ export const ignores = {
817
932
  {
818
933
  files: ['**/*.yaml', '**/*.yml'],
819
934
  rules: {
935
+ ...noUnicorn,
820
936
  'yml/quotes': [
821
937
  2,
822
938
  {
@@ -1059,6 +1175,7 @@ export const ignores = {
1059
1175
  },
1060
1176
  {
1061
1177
  rules: {
1178
+ ...unicornForNode,
1062
1179
  'n/exports-style': [
1063
1180
  2,
1064
1181
  'module.exports',
@@ -1078,8 +1195,6 @@ export const ignores = {
1078
1195
  allowExperimental: true,
1079
1196
  },
1080
1197
  ],
1081
- 'unicorn/no-array-reverse': 2,
1082
- 'unicorn/no-array-sort': 2,
1083
1198
  },
1084
1199
  settings: {
1085
1200
  n: {
@@ -1121,40 +1236,41 @@ export const ignores = {
1121
1236
  'es-x/no-set-prototype-union': 2,
1122
1237
  'es-x/no-string-prototype-iswellformed': 2,
1123
1238
  'es-x/no-string-prototype-towellformed': 2,
1124
- 'unicorn/prefer-structured-clone': 0,
1125
1239
  }),
1126
1240
  browserES8 = getConfig({
1127
- ...esX.configs['flat/restrict-to-es2017'].rules,
1128
- 'es-x/no-array-prototype-flat': 0,
1129
- 'es-x/no-class-instance-fields': 0,
1130
- 'es-x/no-class-private-fields': 0,
1131
- 'es-x/no-class-private-methods': 0,
1132
- 'es-x/no-class-static-blocks': 0,
1133
- 'es-x/no-class-static-fields': 0,
1134
- 'es-x/no-private-in': 0,
1135
- 'es-x/no-logical-assignment-operators': 0,
1136
- 'es-x/no-numeric-separators': 0,
1137
- 'es-x/no-nullish-coalescing-operator': 0,
1138
- 'es-x/no-optional-chaining': 0,
1139
- 'es-x/no-optional-catch-binding': 0,
1140
- 'es-x/no-rest-spread-properties': 0,
1241
+ ...off(esX.configs['flat/restrict-to-es2017'].rules, [
1242
+ 'no-array-prototype-flat',
1243
+ 'no-class-instance-fields',
1244
+ 'no-class-private-fields',
1245
+ 'no-class-private-methods',
1246
+ 'no-class-static-block',
1247
+ 'no-class-static-fields',
1248
+ 'no-private-in',
1249
+ 'no-logical-assignment-operators',
1250
+ 'no-numeric-separators',
1251
+ 'no-nullish-coalescing-operators',
1252
+ 'no-optional-chaining',
1253
+ 'no-optional-catch-binding',
1254
+ 'no-rest-spread-properties',
1255
+ ]),
1141
1256
  'unicorn/prefer-array-last-methods': 0,
1142
1257
  'unicorn/prefer-at': 0,
1143
1258
  'unicorn/prefer-bigint-literals': 0,
1144
1259
  'unicorn/prefer-global-this': 0,
1145
1260
  'unicorn/prefer-object-from-entries': 0,
1146
1261
  'unicorn/prefer-string-replace-all': 0,
1147
- 'unicorn/prefer-structured-clone': 0,
1148
- }),
1149
- dist = getConfig({
1150
- ...esX.configs['flat/restrict-to-es2022'].rules,
1151
- 'es-x/no-array-prototype-findlast-findlastindex': 0,
1152
- 'es-x/no-iterator-prototype-flatmap': 0,
1153
1262
  }),
1154
- distES8 = getConfig({
1155
- ...esX.configs['flat/restrict-to-es2017'].rules,
1156
- 'es-x/no-array-prototype-flat': 0,
1157
- }, 8);
1263
+ dist = getConfig(off(
1264
+ esX.configs['flat/restrict-to-es2022'].rules,
1265
+ [
1266
+ 'no-array-prototype-findlast-findlastindex',
1267
+ 'no-iterator-prototype-flatmap',
1268
+ ],
1269
+ )),
1270
+ distES8 = getConfig(off(
1271
+ esX.configs['flat/restrict-to-es2017'].rules,
1272
+ ['no-array-prototype-flat'],
1273
+ ), 8);
1158
1274
 
1159
1275
  /**
1160
1276
  * 添加ESLint配置项
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bhsd/code-standard",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "homepage": "https://github.com/bhsd-harry/code-standard#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/bhsd-harry/code-standard/issues"
@@ -45,22 +45,22 @@
45
45
  "@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
46
46
  "@stylistic/eslint-plugin": "^5.10.0",
47
47
  "@stylistic/stylelint-plugin": "^5.2.0",
48
- "@types/node": "^25.9.3",
49
- "@typescript-eslint/eslint-plugin": "^8.62.0",
50
- "@typescript-eslint/parser": "^8.62.0",
51
- "eslint-plugin-es-x": "^9.7.0",
52
- "eslint-plugin-jsdoc": "^62.9.0",
53
- "eslint-plugin-jsonc": "^3.1.2",
54
- "eslint-plugin-n": "^18.2.0",
48
+ "@types/node": "^26.1.1",
49
+ "@typescript-eslint/eslint-plugin": "^8.64.0",
50
+ "@typescript-eslint/parser": "^8.64.0",
51
+ "eslint-plugin-es-x": "^10.0.0",
52
+ "eslint-plugin-jsdoc": "^63.1.0",
53
+ "eslint-plugin-jsonc": "^3.3.0",
54
+ "eslint-plugin-n": "^18.2.2",
55
55
  "eslint-plugin-promise": "^7.3.0",
56
- "eslint-plugin-regexp": "^3.1.0",
57
- "eslint-plugin-unicorn": "^65.0.1",
58
- "eslint-plugin-yml": "^3.5.0",
56
+ "eslint-plugin-regexp": "^3.1.1",
57
+ "eslint-plugin-unicorn": "^72.0.0",
58
+ "eslint-plugin-yml": "^3.6.0",
59
59
  "globals": "^17.7.0",
60
60
  "stylelint-plugin-use-baseline": "^1.4.4",
61
61
  "stylelint-config-recommended": "^18.0.0"
62
62
  },
63
63
  "devDependencies": {
64
- "eslint": "^10.6.0"
64
+ "eslint": "^10.7.0"
65
65
  }
66
66
  }