@ofk/eslint-config 0.0.2 → 0.0.3

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 (3) hide show
  1. package/dist/index.js +748 -776
  2. package/dist/index.mjs +748 -776
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,132 +1,138 @@
1
1
  // src/base.ts
2
- import pluginTs13 from "typescript-eslint";
2
+ import pluginTs6 from "typescript-eslint";
3
3
 
4
4
  // src/configs/eslint-comments.ts
5
5
  import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments/configs";
6
- import pluginTs from "typescript-eslint";
7
- var eslintCommentsStrict = pluginTs.config(pluginEslintComments.recommended, {
8
- rules: {
9
- "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
6
+
7
+ // src/utils.ts
8
+ function mergeRules(config, ...rulesSet) {
9
+ return {
10
+ ...config,
11
+ rules: rulesSet.reduce((acc, rules) => ({ ...acc, ...rules }), config.rules)
12
+ };
13
+ }
14
+ function mergeRuleOptions(rule, options) {
15
+ if (Array.isArray(rule)) {
16
+ return [rule[0], { ...rule[1], ...options }];
17
+ }
18
+ if (rule === "error" || rule === "warn") {
19
+ return [rule, options];
10
20
  }
21
+ return rule;
22
+ }
23
+
24
+ // src/configs/eslint-comments.ts
25
+ var eslintCommentsStrict = mergeRules(pluginEslintComments.recommended, {
26
+ "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
11
27
  });
12
28
 
13
29
  // src/configs/imports.ts
14
30
  import pluginImport from "eslint-plugin-import";
15
- import pluginTs2 from "typescript-eslint";
16
- var importsStrict = pluginTs2.config(
31
+ import pluginTs from "typescript-eslint";
32
+ var importsStrict = mergeRules(
17
33
  pluginImport.flatConfigs.recommended,
18
34
  // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#helpful-warnings
19
35
  {
20
- rules: {
21
- "import/no-deprecated": "off",
22
- // discarded
23
- "import/no-empty-named-blocks": "error",
24
- // cf. https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/imports.js#L71
25
- "import/no-extraneous-dependencies": [
26
- "error",
27
- {
28
- devDependencies: [
29
- "test/**",
30
- "tests/**",
31
- "spec/**",
32
- "**/__tests__/**",
33
- "**/__mocks__/**",
34
- "**/*{.,_}{test,spec}.*",
35
- "test.*",
36
- "test-*.*",
37
- "*.{config,setup,conf}.{js,ts,mjs,mts,cjs,cts}",
38
- "*.{config,setup,conf}.*.{js,ts,mjs,mts,cjs,cts}",
39
- ".*rc.{js,ts,mjs,mts,cjs,cts}"
40
- ],
41
- optionalDependencies: false
42
- }
43
- ],
44
- "import/no-mutable-exports": "error",
45
- "import/no-unused-modules": "error"
46
- }
36
+ "import/no-deprecated": "off",
37
+ // discarded
38
+ "import/no-empty-named-blocks": "error",
39
+ // cf. https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/imports.js#L71
40
+ "import/no-extraneous-dependencies": [
41
+ "error",
42
+ {
43
+ devDependencies: [
44
+ "test/**",
45
+ "tests/**",
46
+ "spec/**",
47
+ "**/__tests__/**",
48
+ "**/__mocks__/**",
49
+ "**/*{.,_}{test,spec}.*",
50
+ "test.*",
51
+ "test-*.*",
52
+ "*.{config,setup,conf}.{js,ts,mjs,mts,cjs,cts}",
53
+ "*.{config,setup,conf}.*.{js,ts,mjs,mts,cjs,cts}",
54
+ ".*rc.{js,ts,mjs,mts,cjs,cts}"
55
+ ],
56
+ optionalDependencies: false
57
+ }
58
+ ],
59
+ "import/no-mutable-exports": "error",
60
+ "import/no-unused-modules": "error"
47
61
  },
48
62
  // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#module-systems
49
63
  {
50
- rules: {
51
- "import/no-amd": "error",
52
- "import/no-commonjs": "off",
53
- // disabled for use in esm
54
- "import/no-import-module-exports": "error",
55
- "import/no-nodejs-modules": "error",
56
- "import/unambiguous": "off"
57
- }
64
+ "import/no-amd": "error",
65
+ "import/no-commonjs": "off",
66
+ // disabled for use in esm
67
+ "import/no-import-module-exports": "error",
68
+ "import/no-nodejs-modules": "error",
69
+ "import/unambiguous": "off"
58
70
  },
59
71
  // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#static-analysis
60
72
  {
61
- rules: {
62
- "import/enforce-node-protocol-usage": "off",
63
- // for node.js
64
- "import/no-absolute-path": "error",
65
- "import/no-cycle": "error",
66
- "import/no-dynamic-require": "error",
67
- "import/no-internal-modules": "off",
68
- // discarded
69
- "import/no-relative-packages": "error",
70
- "import/no-relative-parent-imports": "off",
71
- // discarded
72
- "import/no-restricted-paths": "off",
73
- // discarded
74
- "import/no-self-import": "error",
75
- "import/no-useless-path-segments": "error",
76
- "import/no-webpack-loader-syntax": "error"
77
- }
73
+ "import/enforce-node-protocol-usage": "off",
74
+ // for node.js
75
+ "import/no-absolute-path": "error",
76
+ "import/no-cycle": "error",
77
+ "import/no-dynamic-require": "error",
78
+ "import/no-internal-modules": "off",
79
+ // discarded
80
+ "import/no-relative-packages": "error",
81
+ "import/no-relative-parent-imports": "off",
82
+ // discarded
83
+ "import/no-restricted-paths": "off",
84
+ // discarded
85
+ "import/no-self-import": "error",
86
+ "import/no-useless-path-segments": "error",
87
+ "import/no-webpack-loader-syntax": "error"
78
88
  },
79
89
  // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#style-guide
80
90
  {
81
- rules: {
82
- "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
83
- "import/dynamic-import-chunkname": "off",
84
- // don't use webpack
85
- "import/exports-last": "error",
86
- "import/extensions": [
87
- "error",
88
- "ignorePackages",
89
- { cjs: "never", js: "never", jsx: "never", mjs: "never" }
90
- ],
91
- "import/first": "error",
92
- "import/group-exports": "off",
93
- // discarded
94
- "import/max-dependencies": "off",
95
- // disabled style rules
96
- "import/newline-after-import": "error",
97
- "import/no-anonymous-default-export": [
98
- "error",
99
- {
100
- allowArray: true,
101
- allowCallExpression: true,
102
- allowLiteral: true,
103
- allowNew: true,
104
- allowObject: true
105
- }
106
- ],
107
- "import/no-default-export": "error",
108
- // disallow default export
109
- "import/no-duplicates": "error",
110
- "import/no-named-default": "error",
111
- "import/no-named-export": "off",
112
- // disallow default export
113
- "import/no-namespace": "error",
114
- "import/no-unassigned-import": "off",
115
- // allow to use side-effects module
116
- "import/order": ["error", { groups: [["builtin", "external", "internal"]] }],
117
- "import/prefer-default-export": "off",
118
- // discarded
119
- "no-duplicate-imports": "off"
120
- }
91
+ "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
92
+ "import/dynamic-import-chunkname": "off",
93
+ // don't use webpack
94
+ "import/exports-last": "error",
95
+ "import/extensions": [
96
+ "error",
97
+ "ignorePackages",
98
+ { cjs: "never", js: "never", jsx: "never", mjs: "never" }
99
+ ],
100
+ "import/first": "error",
101
+ "import/group-exports": "off",
102
+ // discarded
103
+ "import/max-dependencies": "off",
104
+ // disabled style rules
105
+ "import/newline-after-import": "error",
106
+ "import/no-anonymous-default-export": [
107
+ "error",
108
+ {
109
+ allowArray: true,
110
+ allowCallExpression: true,
111
+ allowLiteral: true,
112
+ allowNew: true,
113
+ allowObject: true
114
+ }
115
+ ],
116
+ "import/no-default-export": "error",
117
+ // disallow default export
118
+ "import/no-duplicates": "error",
119
+ "import/no-named-default": "error",
120
+ "import/no-named-export": "off",
121
+ // disallow default export
122
+ "import/no-namespace": "error",
123
+ "import/no-unassigned-import": "off",
124
+ // allow to use side-effects module
125
+ "import/order": ["error", { groups: [["builtin", "external", "internal"]] }],
126
+ "import/prefer-default-export": "off",
127
+ // discarded
128
+ "no-duplicate-imports": "off"
121
129
  },
122
130
  // disable slow rules due to bugs
123
131
  // https://github.com/import-js/eslint-plugin-import/issues/3148
124
132
  {
125
- rules: {
126
- "import/namespace": "off",
127
- "import/no-cycle": "off",
128
- "import/no-deprecated": "off"
129
- }
133
+ "import/namespace": "off",
134
+ "import/no-cycle": "off",
135
+ "import/no-deprecated": "off"
130
136
  }
131
137
  );
132
138
  function imports({
@@ -135,7 +141,7 @@ function imports({
135
141
  typescript = false,
136
142
  ...config
137
143
  }) {
138
- return pluginTs2.config(
144
+ return pluginTs.config(
139
145
  importsStrict,
140
146
  config,
141
147
  // allow default export in config files
@@ -197,239 +203,231 @@ function imports({
197
203
  import pluginJs from "@eslint/js";
198
204
  import confusingBrowserGlobals from "confusing-browser-globals";
199
205
  import globalVariables from "globals";
200
- import pluginTs3 from "typescript-eslint";
201
- var jsStrict = pluginTs3.config(
206
+ import pluginTs2 from "typescript-eslint";
207
+ var jsStrict = mergeRules(
202
208
  pluginJs.configs.recommended,
203
209
  {
204
- rules: {
205
- "no-empty": "warn",
206
- // override recommended in suggestions
207
- "no-empty-static-block": "warn",
208
- // override recommended in suggestions
209
- "no-misleading-character-class": ["error", { allowEscape: true }],
210
- // override recommended in possible-problems
211
- "no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
212
- // override recommended in possible-problems
213
- "no-unused-vars": [
214
- "warn",
215
- {
216
- argsIgnorePattern: "^_",
217
- caughtErrorsIgnorePattern: "^_",
218
- ignoreRestSiblings: true,
219
- varsIgnorePattern: "^_"
220
- }
221
- ],
222
- // override recommended in possible-problems
223
- "valid-typeof": ["error", { requireStringLiterals: true }]
224
- // override recommended in possible-problems
225
- }
210
+ "no-empty": "warn",
211
+ // override recommended in suggestions
212
+ "no-empty-static-block": "warn",
213
+ // override recommended in suggestions
214
+ "no-misleading-character-class": ["error", { allowEscape: true }],
215
+ // override recommended in possible-problems
216
+ "no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
217
+ // override recommended in possible-problems
218
+ "no-unused-vars": [
219
+ "warn",
220
+ {
221
+ argsIgnorePattern: "^_",
222
+ caughtErrorsIgnorePattern: "^_",
223
+ ignoreRestSiblings: true,
224
+ varsIgnorePattern: "^_"
225
+ }
226
+ ],
227
+ // override recommended in possible-problems
228
+ "valid-typeof": ["error", { requireStringLiterals: true }]
229
+ // override recommended in possible-problems
226
230
  },
227
231
  // https://eslint.org/docs/latest/rules/#possible-problems
228
232
  {
229
- rules: {
230
- "array-callback-return": "error",
231
- "no-await-in-loop": "error",
232
- "no-cond-assign": "error",
233
- "no-constructor-return": "error",
234
- "no-duplicate-imports": "error",
235
- "no-inner-declarations": "error",
236
- "no-promise-executor-return": "error",
237
- "no-self-compare": "error",
238
- "no-template-curly-in-string": "error",
239
- "no-unmodified-loop-condition": "error",
240
- "no-unreachable-loop": "error",
241
- "no-use-before-define": "error",
242
- "no-useless-assignment": "error",
243
- "require-atomic-updates": "error"
244
- }
233
+ "array-callback-return": "error",
234
+ "no-await-in-loop": "error",
235
+ "no-cond-assign": "error",
236
+ "no-constructor-return": "error",
237
+ "no-duplicate-imports": "error",
238
+ "no-inner-declarations": "error",
239
+ "no-promise-executor-return": "error",
240
+ "no-self-compare": "error",
241
+ "no-template-curly-in-string": "error",
242
+ "no-unmodified-loop-condition": "error",
243
+ "no-unreachable-loop": "error",
244
+ "no-use-before-define": "error",
245
+ "no-useless-assignment": "error",
246
+ "require-atomic-updates": "error"
245
247
  },
246
248
  // https://eslint.org/docs/latest/rules/#suggestions
247
249
  {
248
- rules: {
249
- "accessor-pairs": "error",
250
- "arrow-body-style": "error",
251
- "block-scoped-var": "error",
252
- camelcase: ["error", { ignoreDestructuring: false, properties: "never" }],
253
- "capitalized-comments": "off",
254
- // disabled style rules
255
- "class-methods-use-this": "error",
256
- complexity: "off",
257
- // disabled metrics rules
258
- "consistent-return": "error",
259
- "consistent-this": "error",
260
- curly: ["error", "multi-line"],
261
- "default-case": ["error", { commentPattern: "^no default$" }],
262
- "default-case-last": "error",
263
- "default-param-last": "error",
264
- "dot-notation": "error",
265
- eqeqeq: ["error", "always", { null: "ignore" }],
266
- "func-name-matching": "error",
267
- "func-names": ["error", "as-needed"],
268
- "func-style": ["error", "declaration", { allowArrowFunctions: true }],
269
- "grouped-accessor-pairs": ["error", "getBeforeSet"],
270
- "guard-for-in": "error",
271
- "id-denylist": "off",
272
- // disabled style rules
273
- "id-length": "off",
274
- // disabled style rules
275
- "id-match": "off",
276
- // disabled style rules
277
- "init-declarations": "error",
278
- "logical-assignment-operators": ["error", "always", { enforceForIfStatements: true }],
279
- "max-classes-per-file": "error",
280
- "max-depth": "off",
281
- // disabled style rules
282
- "max-lines": "off",
283
- // disabled style rules
284
- "max-lines-per-function": "off",
285
- // disabled style rules
286
- "max-nested-callbacks": "off",
287
- // disabled style rules
288
- "max-params": "off",
289
- // disabled style rules
290
- "max-statements": "off",
291
- // disabled style rules
292
- "new-cap": "error",
293
- "no-alert": "error",
294
- "no-array-constructor": "error",
295
- "no-bitwise": "error",
296
- "no-caller": "error",
297
- "no-console": ["warn", { allow: ["warn", "error", "assert"] }],
298
- "no-continue": "error",
299
- "no-div-regex": "error",
300
- "no-else-return": ["error", { allowElseIf: false }],
301
- "no-empty-function": "warn",
302
- "no-eq-null": "off",
303
- // allow null equals
304
- "no-eval": "error",
305
- "no-extend-native": "error",
306
- "no-extra-bind": "error",
307
- "no-extra-label": "error",
308
- "no-implicit-coercion": ["error", { allow: ["!!"] }],
309
- "no-implicit-globals": "off",
310
- // disabled for use in esm
311
- "no-implied-eval": "error",
312
- "no-inline-comments": "off",
313
- // allow inline comments
314
- "no-invalid-this": "error",
315
- "no-iterator": "error",
316
- "no-label-var": "error",
317
- "no-labels": "error",
318
- "no-lone-blocks": "error",
319
- "no-lonely-if": "error",
320
- "no-loop-func": "error",
321
- "no-magic-numbers": "off",
322
- // allow magic numbers
323
- "no-multi-assign": "error",
324
- "no-multi-str": "error",
325
- "no-negated-condition": "error",
326
- "no-nested-ternary": "error",
327
- "no-new": "error",
328
- "no-new-func": "error",
329
- "no-new-wrappers": "error",
330
- "no-object-constructor": "error",
331
- "no-octal-escape": "error",
332
- "no-param-reassign": "error",
333
- "no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
334
- "no-proto": "error",
335
- // see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/es6.js#L65
336
- "no-restricted-exports": ["error", { restrictedNamedExports: ["default", "then"] }],
337
- // see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/variables.js#L19
338
- "no-restricted-globals": ["error", ...confusingBrowserGlobals],
339
- "no-restricted-imports": "off",
340
- // allow all imports
341
- "no-restricted-properties": "off",
342
- // allow all properties
343
- // see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/style.js#L333
344
- "no-restricted-syntax": [
345
- "error",
346
- {
347
- message: "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.",
348
- selector: "ForInStatement"
349
- },
350
- {
351
- message: "iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.",
352
- selector: "ForOfStatement"
353
- },
354
- {
355
- message: "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.",
356
- selector: "LabeledStatement"
357
- },
358
- {
359
- message: "`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
360
- selector: "WithStatement"
361
- }
362
- ],
363
- "no-return-assign": ["error", "always"],
364
- "no-script-url": "error",
365
- "no-sequences": "error",
366
- "no-shadow": "error",
367
- "no-ternary": "off",
368
- // allow ternary operators
369
- "no-throw-literal": "error",
370
- "no-undef-init": "error",
371
- "no-undefined": "off",
372
- // allow undefined as a value
373
- "no-underscore-dangle": "off",
374
- // allow variable names containing underscores
375
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
376
- "no-unused-expressions": "error",
377
- "no-useless-call": "error",
378
- "no-useless-computed-key": "error",
379
- "no-useless-concat": "error",
380
- "no-useless-constructor": "error",
381
- "no-useless-rename": "error",
382
- "no-useless-return": "error",
383
- "no-var": "error",
384
- "no-void": ["error", { allowAsStatement: true }],
385
- "no-warning-comments": "off",
386
- // disabled style rules
387
- "object-shorthand": ["error", "always", { avoidQuotes: true, ignoreConstructors: false }],
388
- "one-var": ["error", "never"],
389
- "operator-assignment": "error",
390
- "prefer-arrow-callback": "error",
391
- "prefer-const": ["error", { ignoreReadBeforeAssign: true }],
392
- // see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/es6.js#L123
393
- "prefer-destructuring": [
394
- "error",
395
- {
396
- AssignmentExpression: { array: true, object: false },
397
- VariableDeclarator: { array: false, object: true }
398
- },
399
- { enforceForRenamedProperties: false }
400
- ],
401
- "prefer-exponentiation-operator": "error",
402
- "prefer-named-capture-group": "off",
403
- // don't enable new regexp features
404
- "prefer-numeric-literals": "error",
405
- "prefer-object-has-own": "error",
406
- "prefer-object-spread": "error",
407
- "prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
408
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
409
- "prefer-rest-params": "error",
410
- "prefer-spread": "error",
411
- "prefer-template": "error",
412
- radix: "error",
413
- "require-await": "error",
414
- "require-unicode-regexp": "off",
415
- // don't enable new regexp features
416
- "sort-imports": "off",
417
- // disabled style rules
418
- "sort-keys": "off",
419
- // disabled style rules
420
- "sort-vars": "off",
421
- // disabled style rules
422
- strict: ["error", "never"],
423
- "symbol-description": "error",
424
- "vars-on-top": "error",
425
- yoda: "error"
426
- }
250
+ "accessor-pairs": "error",
251
+ "arrow-body-style": "error",
252
+ "block-scoped-var": "error",
253
+ camelcase: ["error", { ignoreDestructuring: false, properties: "never" }],
254
+ "capitalized-comments": "off",
255
+ // disabled style rules
256
+ "class-methods-use-this": "error",
257
+ complexity: "off",
258
+ // disabled metrics rules
259
+ "consistent-return": "error",
260
+ "consistent-this": "error",
261
+ curly: ["error", "multi-line"],
262
+ "default-case": ["error", { commentPattern: "^no default$" }],
263
+ "default-case-last": "error",
264
+ "default-param-last": "error",
265
+ "dot-notation": "error",
266
+ eqeqeq: ["error", "always", { null: "ignore" }],
267
+ "func-name-matching": "error",
268
+ "func-names": ["error", "as-needed"],
269
+ "func-style": ["error", "declaration", { allowArrowFunctions: true }],
270
+ "grouped-accessor-pairs": ["error", "getBeforeSet"],
271
+ "guard-for-in": "error",
272
+ "id-denylist": "off",
273
+ // disabled style rules
274
+ "id-length": "off",
275
+ // disabled style rules
276
+ "id-match": "off",
277
+ // disabled style rules
278
+ "init-declarations": "error",
279
+ "logical-assignment-operators": ["error", "always", { enforceForIfStatements: true }],
280
+ "max-classes-per-file": "error",
281
+ "max-depth": "off",
282
+ // disabled style rules
283
+ "max-lines": "off",
284
+ // disabled style rules
285
+ "max-lines-per-function": "off",
286
+ // disabled style rules
287
+ "max-nested-callbacks": "off",
288
+ // disabled style rules
289
+ "max-params": "off",
290
+ // disabled style rules
291
+ "max-statements": "off",
292
+ // disabled style rules
293
+ "new-cap": "error",
294
+ "no-alert": "error",
295
+ "no-array-constructor": "error",
296
+ "no-bitwise": "error",
297
+ "no-caller": "error",
298
+ "no-console": ["warn", { allow: ["warn", "error", "assert"] }],
299
+ "no-continue": "error",
300
+ "no-div-regex": "error",
301
+ "no-else-return": ["error", { allowElseIf: false }],
302
+ "no-empty-function": "warn",
303
+ "no-eq-null": "off",
304
+ // allow null equals
305
+ "no-eval": "error",
306
+ "no-extend-native": "error",
307
+ "no-extra-bind": "error",
308
+ "no-extra-label": "error",
309
+ "no-implicit-coercion": ["error", { allow: ["!!"] }],
310
+ "no-implicit-globals": "off",
311
+ // disabled for use in esm
312
+ "no-implied-eval": "error",
313
+ "no-inline-comments": "off",
314
+ // allow inline comments
315
+ "no-invalid-this": "error",
316
+ "no-iterator": "error",
317
+ "no-label-var": "error",
318
+ "no-labels": "error",
319
+ "no-lone-blocks": "error",
320
+ "no-lonely-if": "error",
321
+ "no-loop-func": "error",
322
+ "no-magic-numbers": "off",
323
+ // allow magic numbers
324
+ "no-multi-assign": "error",
325
+ "no-multi-str": "error",
326
+ "no-negated-condition": "error",
327
+ "no-nested-ternary": "error",
328
+ "no-new": "error",
329
+ "no-new-func": "error",
330
+ "no-new-wrappers": "error",
331
+ "no-object-constructor": "error",
332
+ "no-octal-escape": "error",
333
+ "no-param-reassign": "error",
334
+ "no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
335
+ "no-proto": "error",
336
+ // see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/es6.js#L65
337
+ "no-restricted-exports": ["error", { restrictedNamedExports: ["default", "then"] }],
338
+ // see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/variables.js#L19
339
+ "no-restricted-globals": ["error", ...confusingBrowserGlobals],
340
+ "no-restricted-imports": "off",
341
+ // allow all imports
342
+ "no-restricted-properties": "off",
343
+ // allow all properties
344
+ // see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/style.js#L333
345
+ "no-restricted-syntax": [
346
+ "error",
347
+ {
348
+ message: "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.",
349
+ selector: "ForInStatement"
350
+ },
351
+ {
352
+ message: "iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.",
353
+ selector: "ForOfStatement"
354
+ },
355
+ {
356
+ message: "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.",
357
+ selector: "LabeledStatement"
358
+ },
359
+ {
360
+ message: "`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
361
+ selector: "WithStatement"
362
+ }
363
+ ],
364
+ "no-return-assign": ["error", "always"],
365
+ "no-script-url": "error",
366
+ "no-sequences": "error",
367
+ "no-shadow": "error",
368
+ "no-ternary": "off",
369
+ // allow ternary operators
370
+ "no-throw-literal": "error",
371
+ "no-undef-init": "error",
372
+ "no-undefined": "off",
373
+ // allow undefined as a value
374
+ "no-underscore-dangle": "off",
375
+ // allow variable names containing underscores
376
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
377
+ "no-unused-expressions": "error",
378
+ "no-useless-call": "error",
379
+ "no-useless-computed-key": "error",
380
+ "no-useless-concat": "error",
381
+ "no-useless-constructor": "error",
382
+ "no-useless-rename": "error",
383
+ "no-useless-return": "error",
384
+ "no-var": "error",
385
+ "no-void": ["error", { allowAsStatement: true }],
386
+ "no-warning-comments": "off",
387
+ // disabled style rules
388
+ "object-shorthand": ["error", "always", { avoidQuotes: true, ignoreConstructors: false }],
389
+ "one-var": ["error", "never"],
390
+ "operator-assignment": "error",
391
+ "prefer-arrow-callback": "error",
392
+ "prefer-const": ["error", { ignoreReadBeforeAssign: true }],
393
+ // see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/es6.js#L123
394
+ "prefer-destructuring": [
395
+ "error",
396
+ {
397
+ AssignmentExpression: { array: true, object: false },
398
+ VariableDeclarator: { array: false, object: true }
399
+ },
400
+ { enforceForRenamedProperties: false }
401
+ ],
402
+ "prefer-exponentiation-operator": "error",
403
+ "prefer-named-capture-group": "off",
404
+ // don't enable new regexp features
405
+ "prefer-numeric-literals": "error",
406
+ "prefer-object-has-own": "error",
407
+ "prefer-object-spread": "error",
408
+ "prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
409
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
410
+ "prefer-rest-params": "error",
411
+ "prefer-spread": "error",
412
+ "prefer-template": "error",
413
+ radix: "error",
414
+ "require-await": "error",
415
+ "require-unicode-regexp": "off",
416
+ // don't enable new regexp features
417
+ "sort-imports": "off",
418
+ // disabled style rules
419
+ "sort-keys": "off",
420
+ // disabled style rules
421
+ "sort-vars": "off",
422
+ // disabled style rules
423
+ strict: ["error", "never"],
424
+ "symbol-description": "error",
425
+ "vars-on-top": "error",
426
+ yoda: "error"
427
427
  },
428
428
  // https://eslint.org/docs/latest/rules/#layout--formatting
429
429
  {
430
- rules: {
431
- "unicode-bom": "error"
432
- }
430
+ "unicode-bom": "error"
433
431
  }
434
432
  );
435
433
  function jsGlobals({
@@ -437,7 +435,7 @@ function jsGlobals({
437
435
  es2024 = true,
438
436
  node = true
439
437
  }) {
440
- return pluginTs3.config({
438
+ return pluginTs2.config({
441
439
  languageOptions: {
442
440
  globals: {
443
441
  ...es2024 ? globalVariables.es2024 : {},
@@ -451,256 +449,232 @@ function js({
451
449
  globals = {},
452
450
  ...config
453
451
  }) {
454
- return pluginTs3.config(globals ? jsGlobals(globals) : {}, jsStrict, config);
452
+ return pluginTs2.config(globals ? jsGlobals(globals) : {}, jsStrict, config);
455
453
  }
456
454
 
457
455
  // src/configs/jsx-a11y.ts
458
456
  import pluginJsxA11y from "eslint-plugin-jsx-a11y";
459
- import pluginTs4 from "typescript-eslint";
460
- var jsxA11yStrict = pluginTs4.config(pluginJsxA11y.flatConfigs.recommended, {
461
- rules: {
462
- "jsx-a11y/accessible-emoji": "off",
463
- // deprecated
464
- "jsx-a11y/lang": "error",
465
- "jsx-a11y/no-aria-hidden-on-focusable": "off",
466
- "jsx-a11y/no-onchange": "off",
467
- // deprecated
468
- "jsx-a11y/prefer-tag-over-role": "off"
469
- }
457
+ var jsxA11yStrict = mergeRules(pluginJsxA11y.flatConfigs.recommended, {
458
+ "jsx-a11y/accessible-emoji": "off",
459
+ // deprecated
460
+ "jsx-a11y/lang": "error",
461
+ "jsx-a11y/no-aria-hidden-on-focusable": "off",
462
+ "jsx-a11y/no-onchange": "off",
463
+ // deprecated
464
+ "jsx-a11y/prefer-tag-over-role": "off"
470
465
  });
471
466
 
472
467
  // src/configs/perfectionist.ts
473
468
  import pluginPerfectionist from "eslint-plugin-perfectionist";
474
- import pluginTs5 from "typescript-eslint";
475
- function mergeRuleOptions(rule, options) {
476
- if (Array.isArray(rule)) {
477
- return [rule[0], { ...rule[1], ...options }];
478
- }
479
- return rule;
480
- }
481
- function mergeConfig(config, options) {
482
- return {
483
- ...config,
484
- rules: config.rules ? Object.fromEntries(
485
- Object.entries(config.rules).map(([name, rule]) => [
486
- name,
487
- mergeRuleOptions(rule, options)
488
- ])
489
- ) : void 0
490
- };
491
- }
492
- var perfectionistRecommended = mergeConfig(pluginPerfectionist.configs["recommended-natural"], {
493
- ignoreCase: false
494
- });
495
- var perfectionistStrict = pluginTs5.config(
469
+ var perfectionistRecommended = {
470
+ ...pluginPerfectionist.configs["recommended-natural"],
471
+ rules: Object.fromEntries(
472
+ Object.entries(pluginPerfectionist.configs["recommended-natural"].rules ?? {}).map(
473
+ ([name, rule]) => [name, mergeRuleOptions(rule, { ignoreCase: false })]
474
+ )
475
+ )
476
+ };
477
+ var perfectionistStrict = mergeRules(
496
478
  perfectionistRecommended,
497
479
  {
498
- rules: {
499
- // see https://perfectionist.dev/rules/sort-imports
500
- "perfectionist/sort-imports": mergeRuleOptions(
501
- perfectionistRecommended.rules["perfectionist/sort-imports"],
502
- {
503
- groups: [
504
- "type",
505
- ["builtin", "external"],
506
- "internal-type",
507
- "internal",
508
- ["parent-type", "sibling-type", "index-type"],
509
- ["parent", "sibling", "index"],
510
- "object",
511
- "side-effect",
512
- "side-effect-style",
513
- "unknown"
514
- ],
515
- internalPattern: [
516
- "^[@~]/.*"
517
- // next.js/remix default pattern
518
- ]
519
- }
520
- ),
521
- // see https://perfectionist.dev/rules/sort-jsx-props
522
- "perfectionist/sort-jsx-props": mergeRuleOptions(
523
- perfectionistRecommended.rules["perfectionist/sort-jsx-props"],
524
- {
525
- customGroups: {
526
- reserved: "^(?:key|ref)$"
527
- },
528
- groups: ["reserved", "unknown"]
529
- }
530
- ),
531
- // see https://perfectionist.dev/rules/sort-union-types
532
- "perfectionist/sort-union-types": mergeRuleOptions(
533
- perfectionistRecommended.rules["perfectionist/sort-union-types"],
534
- {
535
- groups: ["unknown", "nullish"]
536
- }
537
- )
538
- }
480
+ // see https://perfectionist.dev/rules/sort-imports
481
+ "perfectionist/sort-imports": mergeRuleOptions(
482
+ perfectionistRecommended.rules["perfectionist/sort-imports"],
483
+ {
484
+ groups: [
485
+ "type",
486
+ ["builtin", "external"],
487
+ "internal-type",
488
+ "internal",
489
+ ["parent-type", "sibling-type", "index-type"],
490
+ ["parent", "sibling", "index"],
491
+ "object",
492
+ "side-effect",
493
+ "side-effect-style",
494
+ "unknown"
495
+ ],
496
+ internalPattern: [
497
+ "^[@~]/.*"
498
+ // next.js/remix default pattern
499
+ ]
500
+ }
501
+ ),
502
+ // see https://perfectionist.dev/rules/sort-jsx-props
503
+ "perfectionist/sort-jsx-props": mergeRuleOptions(
504
+ perfectionistRecommended.rules["perfectionist/sort-jsx-props"],
505
+ {
506
+ customGroups: {
507
+ reserved: "^(?:key|ref)$"
508
+ },
509
+ groups: ["reserved", "unknown"]
510
+ }
511
+ ),
512
+ // see https://perfectionist.dev/rules/sort-union-types
513
+ "perfectionist/sort-union-types": mergeRuleOptions(
514
+ perfectionistRecommended.rules["perfectionist/sort-union-types"],
515
+ {
516
+ groups: ["unknown", "nullish"]
517
+ }
518
+ )
539
519
  },
540
520
  {
541
- rules: {
542
- // disable sorting of method definitions that conflict with no-use-before-define
543
- "perfectionist/sort-classes": "off",
544
- "perfectionist/sort-modules": "off"
545
- }
521
+ // disable sorting of method definitions that conflict with no-use-before-define
522
+ "perfectionist/sort-classes": "off",
523
+ "perfectionist/sort-modules": "off"
546
524
  },
547
525
  {
548
- rules: {
549
- // conflict with https://perfectionist.dev/rules/sort-interfaces
550
- // https://perfectionist.dev/rules/sort-object-types
551
- "@typescript-eslint/adjacent-overload-signatures": "off",
552
- // conflict with https://perfectionist.dev/rules/sort-classes
553
- "@typescript-eslint/member-ordering": "off",
554
- // conflict with https://perfectionist.dev/rules/sort-intersection-types
555
- // https://perfectionist.dev/rules/sort-union-types
556
- "@typescript-eslint/sort-type-constituents": "off",
557
- // conflict with https://perfectionist.dev/rules/sort-imports
558
- // https://perfectionist.dev/rules/sort-named-imports
559
- "import/order": "off",
560
- // conflict with https://perfectionist.dev/rules/sort-jsx-props
561
- "react/jsx-sort-props": "off",
562
- // conflict with https://perfectionist.dev/rules/sort-classes
563
- "react/sort-comp": "off",
564
- // conflict with https://perfectionist.dev/rules/sort-objects
565
- "react/sort-default-props": "off",
566
- "react/sort-prop-types": "off",
567
- // conflict with https://perfectionist.dev/rules/sort-imports
568
- // https://perfectionist.dev/rules/sort-named-imports
569
- "sort-imports": "off",
570
- // conflict with https://perfectionist.dev/rules/sort-objects
571
- "sort-keys": "off"
572
- }
526
+ // conflict with https://perfectionist.dev/rules/sort-interfaces
527
+ // https://perfectionist.dev/rules/sort-object-types
528
+ "@typescript-eslint/adjacent-overload-signatures": "off",
529
+ // conflict with https://perfectionist.dev/rules/sort-classes
530
+ "@typescript-eslint/member-ordering": "off",
531
+ // conflict with https://perfectionist.dev/rules/sort-intersection-types
532
+ // https://perfectionist.dev/rules/sort-union-types
533
+ "@typescript-eslint/sort-type-constituents": "off",
534
+ // conflict with https://perfectionist.dev/rules/sort-imports
535
+ // https://perfectionist.dev/rules/sort-named-imports
536
+ "import/order": "off",
537
+ // conflict with https://perfectionist.dev/rules/sort-jsx-props
538
+ "react/jsx-sort-props": "off",
539
+ // conflict with https://perfectionist.dev/rules/sort-classes
540
+ "react/sort-comp": "off",
541
+ // conflict with https://perfectionist.dev/rules/sort-objects
542
+ "react/sort-default-props": "off",
543
+ "react/sort-prop-types": "off",
544
+ // conflict with https://perfectionist.dev/rules/sort-imports
545
+ // https://perfectionist.dev/rules/sort-named-imports
546
+ "sort-imports": "off",
547
+ // conflict with https://perfectionist.dev/rules/sort-objects
548
+ "sort-keys": "off"
573
549
  }
574
550
  );
575
551
 
576
552
  // src/configs/react.ts
577
553
  import pluginReact from "eslint-plugin-react";
578
- import pluginTs6 from "typescript-eslint";
579
- var reactStrict = pluginTs6.config(pluginReact.configs.flat.recommended, {
580
- rules: {
581
- "react/boolean-prop-naming": "off",
582
- "react/button-has-type": ["error", { button: true, reset: false, submit: true }],
583
- "react/checked-requires-onchange-or-readonly": "off",
584
- "react/default-props-match-prop-types": "off",
585
- "react/destructuring-assignment": ["error", "always"],
586
- "react/forbid-component-props": "off",
587
- "react/forbid-dom-props": "off",
588
- "react/forbid-elements": "off",
589
- "react/forbid-foreign-prop-types": ["warn", { allowInPropTypes: true }],
590
- "react/forbid-prop-types": [
591
- "error",
592
- {
593
- checkChildContextTypes: true,
594
- checkContextTypes: true,
595
- forbid: ["any", "array", "object"]
596
- }
597
- ],
598
- "react/forward-ref-uses-ref": "error",
599
- "react/function-component-definition": [
600
- "error",
601
- { namedComponents: "function-declaration", unnamedComponents: "function-expression" }
602
- ],
603
- "react/hook-use-state": "error",
604
- "react/iframe-missing-sandbox": "error",
605
- "react/jsx-boolean-value": ["error", "never"],
606
- "react/jsx-child-element-spacing": "off",
607
- "react/jsx-closing-bracket-location": ["error", "line-aligned"],
608
- "react/jsx-closing-tag-location": "error",
609
- "react/jsx-curly-brace-presence": ["error", { children: "never", props: "never" }],
610
- "react/jsx-curly-newline": ["error", { multiline: "consistent", singleline: "consistent" }],
611
- "react/jsx-curly-spacing": ["error", "never", { allowMultiline: true }],
612
- "react/jsx-equals-spacing": ["error", "never"],
613
- "react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }],
614
- "react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
615
- "react/jsx-fragments": ["error", "syntax"],
616
- "react/jsx-handler-names": "off",
617
- "react/jsx-indent": ["error", 2],
618
- "react/jsx-indent-props": ["error", 2],
619
- "react/jsx-max-depth": "off",
620
- "react/jsx-max-props-per-line": ["error", { maximum: 1, when: "multiline" }],
621
- "react/jsx-newline": "off",
622
- "react/jsx-no-bind": [
623
- "error",
624
- {
625
- allowArrowFunctions: true,
626
- allowBind: false,
627
- allowFunctions: false,
628
- ignoreDOMComponents: true,
629
- ignoreRefs: true
630
- }
631
- ],
632
- "react/jsx-no-constructed-context-values": "error",
633
- "react/jsx-no-leaked-render": ["error", { validStrategies: ["ternary"] }],
634
- "react/jsx-no-literals": "off",
635
- "react/jsx-no-script-url": ["error", [{ name: "Link", props: ["to"] }]],
636
- "react/jsx-no-useless-fragment": "error",
637
- "react/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
638
- "react/jsx-pascal-case": ["error", { allowAllCaps: true }],
639
- "react/jsx-props-no-multi-spaces": "error",
640
- "react/jsx-props-no-spread-multi": "error",
641
- "react/jsx-props-no-spreading": "off",
642
- "react/jsx-sort-props": "off",
643
- "react/jsx-tag-spacing": [
644
- "error",
645
- {
646
- afterOpening: "never",
647
- beforeClosing: "never",
648
- beforeSelfClosing: "always",
649
- closingSlash: "never"
650
- }
651
- ],
652
- "react/jsx-wrap-multilines": [
653
- "error",
654
- {
655
- arrow: "parens-new-line",
656
- assignment: "parens-new-line",
657
- condition: "parens-new-line",
658
- declaration: "parens-new-line",
659
- logical: "parens-new-line",
660
- prop: "parens-new-line",
661
- return: "parens-new-line"
662
- }
663
- ],
664
- "react/no-access-state-in-setstate": "error",
665
- "react/no-adjacent-inline-elements": "off",
666
- "react/no-array-index-key": "error",
667
- "react/no-arrow-function-lifecycle": "error",
668
- "react/no-danger": "warn",
669
- "react/no-did-mount-set-state": "off",
670
- "react/no-did-update-set-state": "error",
671
- "react/no-invalid-html-attribute": "error",
672
- "react/no-multi-comp": "off",
673
- "react/no-namespace": "error",
674
- "react/no-object-type-as-default-prop": "error",
675
- "react/no-redundant-should-component-update": "error",
676
- "react/no-set-state": "off",
677
- "react/no-this-in-sfc": "error",
678
- "react/no-typos": "error",
679
- "react/no-unstable-nested-components": "error",
680
- "react/no-unused-class-component-methods": "error",
681
- "react/no-unused-prop-types": "error",
682
- "react/no-unused-state": "error",
683
- "react/no-will-update-set-state": "error",
684
- "react/prefer-es6-class": ["error", "always"],
685
- "react/prefer-exact-props": "error",
686
- "react/prefer-read-only-props": "off",
687
- // too strict
688
- "react/prefer-stateless-function": ["error", { ignorePureComponents: true }],
689
- "react/require-default-props": "off",
690
- // disallow defaultProps
691
- "react/require-optimization": "off",
692
- "react/self-closing-comp": "error",
693
- "react/sort-comp": "error",
694
- "react/sort-default-props": "error",
695
- "react/sort-prop-types": "error",
696
- "react/state-in-constructor": ["error", "never"],
697
- "react/static-property-placement": ["error", "property assignment"],
698
- "react/style-prop-object": "error",
699
- "react/void-dom-elements-no-children": "error"
700
- }
554
+ import pluginTs3 from "typescript-eslint";
555
+ var reactStrict = mergeRules(pluginReact.configs.flat.recommended ?? {}, {
556
+ "react/boolean-prop-naming": "off",
557
+ "react/button-has-type": ["error", { button: true, reset: false, submit: true }],
558
+ "react/checked-requires-onchange-or-readonly": "off",
559
+ "react/default-props-match-prop-types": "off",
560
+ "react/destructuring-assignment": ["error", "always"],
561
+ "react/forbid-component-props": "off",
562
+ "react/forbid-dom-props": "off",
563
+ "react/forbid-elements": "off",
564
+ "react/forbid-foreign-prop-types": ["warn", { allowInPropTypes: true }],
565
+ "react/forbid-prop-types": [
566
+ "error",
567
+ {
568
+ checkChildContextTypes: true,
569
+ checkContextTypes: true,
570
+ forbid: ["any", "array", "object"]
571
+ }
572
+ ],
573
+ "react/forward-ref-uses-ref": "error",
574
+ "react/function-component-definition": [
575
+ "error",
576
+ { namedComponents: "function-declaration", unnamedComponents: "function-expression" }
577
+ ],
578
+ "react/hook-use-state": "error",
579
+ "react/iframe-missing-sandbox": "error",
580
+ "react/jsx-boolean-value": ["error", "never"],
581
+ "react/jsx-child-element-spacing": "off",
582
+ "react/jsx-closing-bracket-location": ["error", "line-aligned"],
583
+ "react/jsx-closing-tag-location": "error",
584
+ "react/jsx-curly-brace-presence": ["error", { children: "never", props: "never" }],
585
+ "react/jsx-curly-newline": ["error", { multiline: "consistent", singleline: "consistent" }],
586
+ "react/jsx-curly-spacing": ["error", "never", { allowMultiline: true }],
587
+ "react/jsx-equals-spacing": ["error", "never"],
588
+ "react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }],
589
+ "react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
590
+ "react/jsx-fragments": ["error", "syntax"],
591
+ "react/jsx-handler-names": "off",
592
+ "react/jsx-indent": ["error", 2],
593
+ "react/jsx-indent-props": ["error", 2],
594
+ "react/jsx-max-depth": "off",
595
+ "react/jsx-max-props-per-line": ["error", { maximum: 1, when: "multiline" }],
596
+ "react/jsx-newline": "off",
597
+ "react/jsx-no-bind": [
598
+ "error",
599
+ {
600
+ allowArrowFunctions: true,
601
+ allowBind: false,
602
+ allowFunctions: false,
603
+ ignoreDOMComponents: true,
604
+ ignoreRefs: true
605
+ }
606
+ ],
607
+ "react/jsx-no-constructed-context-values": "error",
608
+ "react/jsx-no-leaked-render": ["error", { validStrategies: ["ternary"] }],
609
+ "react/jsx-no-literals": "off",
610
+ "react/jsx-no-script-url": ["error", [{ name: "Link", props: ["to"] }]],
611
+ "react/jsx-no-useless-fragment": "error",
612
+ "react/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
613
+ "react/jsx-pascal-case": ["error", { allowAllCaps: true }],
614
+ "react/jsx-props-no-multi-spaces": "error",
615
+ "react/jsx-props-no-spread-multi": "error",
616
+ "react/jsx-props-no-spreading": "off",
617
+ "react/jsx-sort-props": "off",
618
+ "react/jsx-tag-spacing": [
619
+ "error",
620
+ {
621
+ afterOpening: "never",
622
+ beforeClosing: "never",
623
+ beforeSelfClosing: "always",
624
+ closingSlash: "never"
625
+ }
626
+ ],
627
+ "react/jsx-wrap-multilines": [
628
+ "error",
629
+ {
630
+ arrow: "parens-new-line",
631
+ assignment: "parens-new-line",
632
+ condition: "parens-new-line",
633
+ declaration: "parens-new-line",
634
+ logical: "parens-new-line",
635
+ prop: "parens-new-line",
636
+ return: "parens-new-line"
637
+ }
638
+ ],
639
+ "react/no-access-state-in-setstate": "error",
640
+ "react/no-adjacent-inline-elements": "off",
641
+ "react/no-array-index-key": "error",
642
+ "react/no-arrow-function-lifecycle": "error",
643
+ "react/no-danger": "warn",
644
+ "react/no-did-mount-set-state": "off",
645
+ "react/no-did-update-set-state": "error",
646
+ "react/no-invalid-html-attribute": "error",
647
+ "react/no-multi-comp": "off",
648
+ "react/no-namespace": "error",
649
+ "react/no-object-type-as-default-prop": "error",
650
+ "react/no-redundant-should-component-update": "error",
651
+ "react/no-set-state": "off",
652
+ "react/no-this-in-sfc": "error",
653
+ "react/no-typos": "error",
654
+ "react/no-unstable-nested-components": "error",
655
+ "react/no-unused-class-component-methods": "error",
656
+ "react/no-unused-prop-types": "error",
657
+ "react/no-unused-state": "error",
658
+ "react/no-will-update-set-state": "error",
659
+ "react/prefer-es6-class": ["error", "always"],
660
+ "react/prefer-exact-props": "error",
661
+ "react/prefer-read-only-props": "off",
662
+ // too strict
663
+ "react/prefer-stateless-function": ["error", { ignorePureComponents: true }],
664
+ "react/require-default-props": "off",
665
+ // disallow defaultProps
666
+ "react/require-optimization": "off",
667
+ "react/self-closing-comp": "error",
668
+ "react/sort-comp": "error",
669
+ "react/sort-default-props": "error",
670
+ "react/sort-prop-types": "error",
671
+ "react/state-in-constructor": ["error", "never"],
672
+ "react/static-property-placement": ["error", "property assignment"],
673
+ "react/style-prop-object": "error",
674
+ "react/void-dom-elements-no-children": "error"
701
675
  });
702
676
  function react(config) {
703
- return pluginTs6.config(
677
+ return pluginTs3.config(
704
678
  {
705
679
  settings: {
706
680
  react: {
@@ -718,8 +692,7 @@ function react(config) {
718
692
 
719
693
  // src/configs/react-hooks.ts
720
694
  import pluginReactHooks from "eslint-plugin-react-hooks";
721
- import pluginTs7 from "typescript-eslint";
722
- var reactHooksStrict = pluginTs7.config(
695
+ var reactHooksStrict = mergeRules(
723
696
  // Flat Config version has not been released yet.
724
697
  {
725
698
  plugins: { "react-hooks": pluginReactHooks },
@@ -729,51 +702,101 @@ var reactHooksStrict = pluginTs7.config(
729
702
 
730
703
  // src/configs/react-refresh.ts
731
704
  import pluginReactRefresh from "eslint-plugin-react-refresh";
732
- import pluginTs8 from "typescript-eslint";
733
- var reactRefreshStrict = pluginTs8.config(pluginReactRefresh.configs.recommended);
705
+ var reactRefreshStrict = mergeRules(pluginReactRefresh.configs.recommended);
734
706
 
735
707
  // src/configs/ts.ts
736
- import pluginTs9 from "typescript-eslint";
737
- var tsRecommendedOverride = pluginTs9.config(
708
+ import pluginTs4 from "typescript-eslint";
709
+ var jsStrictRules = jsStrict.rules ?? {};
710
+ var tsEslintOverrideRules = mergeRules(
711
+ {},
712
+ // see https://github.com/typescript-eslint/typescript-eslint/blob/v8.22.0/packages/eslint-plugin/src/configs/strict-type-checked.ts
713
+ {
714
+ "@typescript-eslint/no-array-constructor": jsStrictRules["no-array-constructor"],
715
+ "@typescript-eslint/no-implied-eval": jsStrictRules["no-implied-eval"],
716
+ "@typescript-eslint/no-unused-expressions": jsStrictRules["no-unused-expressions"],
717
+ "@typescript-eslint/no-unused-vars": jsStrictRules["no-unused-vars"],
718
+ "@typescript-eslint/no-useless-constructor": jsStrictRules["no-useless-constructor"],
719
+ "@typescript-eslint/prefer-promise-reject-errors": jsStrictRules["prefer-promise-reject-errors"],
720
+ "@typescript-eslint/require-await": jsStrictRules["require-await"],
721
+ "no-array-constructor": "off",
722
+ "no-implied-eval": "off",
723
+ "no-unused-expressions": "off",
724
+ "no-unused-vars": "off",
725
+ "no-useless-constructor": "off",
726
+ "prefer-promise-reject-errors": "off",
727
+ "require-await": "off"
728
+ },
729
+ // see https://github.com/typescript-eslint/typescript-eslint/blob/v8.22.0/packages/eslint-plugin/src/configs/stylistic-type-checked.ts
730
+ {
731
+ "@typescript-eslint/dot-notation": jsStrictRules["dot-notation"],
732
+ "@typescript-eslint/no-empty-function": jsStrictRules["no-empty-function"],
733
+ "dot-notation": "off",
734
+ "no-empty-function": "off"
735
+ },
736
+ // others
737
+ {
738
+ "@typescript-eslint/class-methods-use-this": jsStrictRules["class-methods-use-this"],
739
+ "@typescript-eslint/default-param-last": jsStrictRules["default-param-last"],
740
+ "@typescript-eslint/init-declarations": jsStrictRules["init-declarations"],
741
+ "@typescript-eslint/max-params": jsStrictRules["max-params"],
742
+ "@typescript-eslint/no-dupe-class-members": jsStrictRules["no-dupe-class-members"],
743
+ "@typescript-eslint/no-invalid-this": jsStrictRules["no-invalid-this"],
744
+ "@typescript-eslint/no-loop-func": jsStrictRules["no-loop-func"],
745
+ "@typescript-eslint/no-magic-numbers": jsStrictRules["no-magic-numbers"],
746
+ "@typescript-eslint/no-redeclare": jsStrictRules["no-redeclare"],
747
+ "@typescript-eslint/no-restricted-imports": jsStrictRules["no-restricted-imports"],
748
+ "@typescript-eslint/no-shadow": jsStrictRules["no-shadow"],
749
+ "@typescript-eslint/no-use-before-define": jsStrictRules["no-use-before-define"],
750
+ "@typescript-eslint/prefer-destructuring": jsStrictRules["prefer-destructuring"],
751
+ "class-methods-use-this": "off",
752
+ "default-param-last": "off",
753
+ "init-declarations": "off",
754
+ "max-params": "off",
755
+ "no-dupe-class-members": "off",
756
+ "no-invalid-this": "off",
757
+ "no-loop-func": "off",
758
+ "no-magic-numbers": "off",
759
+ "no-redeclare": "off",
760
+ "no-restricted-imports": "off",
761
+ "no-shadow": "off",
762
+ "no-use-before-define": "off",
763
+ "prefer-destructuring": "off"
764
+ }
765
+ );
766
+ var tsRecommendedOverride = mergeRules(
767
+ {},
738
768
  // override rules in recommended
739
769
  {
740
- rules: {
741
- // override no-empty-object-type in recommended
742
- "@typescript-eslint/no-empty-object-type": [
743
- "error",
744
- { allowInterfaces: "with-single-extends" }
745
- ],
746
- // override no-unused-vars in recommended
747
- "@typescript-eslint/no-unused-vars": [
748
- "warn",
749
- {
750
- argsIgnorePattern: "^_",
751
- caughtErrorsIgnorePattern: "^_",
752
- ignoreRestSiblings: true,
753
- varsIgnorePattern: "^_"
754
- }
755
- ]
756
- }
770
+ // override no-empty-object-type in recommended
771
+ "@typescript-eslint/no-empty-object-type": [
772
+ "error",
773
+ { allowInterfaces: "with-single-extends" }
774
+ ]
757
775
  },
758
776
  // best practices
759
777
  {
760
- rules: {
761
- "@typescript-eslint/consistent-type-exports": "error",
762
- "@typescript-eslint/consistent-type-imports": "error",
763
- "no-duplicate-imports": "off"
764
- // confilict with @typescript-eslint/consistent-type-imports
765
- }
778
+ "@typescript-eslint/consistent-type-exports": "error",
779
+ "@typescript-eslint/consistent-type-imports": "error",
780
+ "@typescript-eslint/no-dupe-class-members": "off",
781
+ // disabled because tsc checks
782
+ "@typescript-eslint/no-invalid-this": "off",
783
+ // disabled because tsc checks
784
+ "no-duplicate-imports": "off"
785
+ // confilict with @typescript-eslint/consistent-type-imports
766
786
  }
767
787
  );
768
- var tsRecommended = pluginTs9.config(pluginTs9.configs.recommended, tsRecommendedOverride);
769
- var tsStrict = pluginTs9.config(
770
- pluginTs9.configs.strictTypeChecked,
771
- pluginTs9.configs.stylisticTypeChecked,
788
+ var tsRecommended = pluginTs4.config(
789
+ pluginTs4.configs.recommended,
790
+ tsEslintOverrideRules,
791
+ tsRecommendedOverride
792
+ );
793
+ var tsStrict = pluginTs4.config(
794
+ pluginTs4.configs.strictTypeChecked,
795
+ pluginTs4.configs.stylisticTypeChecked,
796
+ tsEslintOverrideRules,
772
797
  tsRecommendedOverride,
773
798
  {
774
799
  rules: {
775
- // override no-empty-function in stylistic
776
- "@typescript-eslint/no-empty-function": "warn",
777
800
  // override no-unnecessary-condition in strict
778
801
  "@typescript-eslint/no-unnecessary-condition": [
779
802
  "error",
@@ -786,51 +809,26 @@ var tsStrict = pluginTs9.config(
786
809
  },
787
810
  {
788
811
  rules: {
789
- "@typescript-eslint/class-methods-use-this": "error",
790
812
  "@typescript-eslint/consistent-return": "off",
791
813
  // disabled because tsc checks
792
- "@typescript-eslint/default-param-last": "error",
793
814
  "@typescript-eslint/explicit-function-return-type": "error",
794
815
  "@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
795
816
  "@typescript-eslint/explicit-module-boundary-types": "off",
796
817
  // typescript-eslint/explicit-function-return-type is enabled
797
- "@typescript-eslint/init-declarations": "error",
798
- "@typescript-eslint/max-params": "off",
799
- // disabled like js
800
818
  "@typescript-eslint/member-ordering": "off",
801
819
  // disabled style rules
802
820
  "@typescript-eslint/method-signature-style": "error",
803
821
  "@typescript-eslint/naming-convention": "off",
804
822
  // disabled style rules
805
- "@typescript-eslint/no-dupe-class-members": "off",
806
- // disabled because tsc checks
807
823
  "@typescript-eslint/no-import-type-side-effects": "error",
808
- "@typescript-eslint/no-invalid-this": "off",
809
- // disabled because tsc checks
810
- "@typescript-eslint/no-loop-func": "error",
811
- "@typescript-eslint/no-magic-numbers": "off",
812
- // disabled like js
813
- "@typescript-eslint/no-redeclare": "error",
814
- "@typescript-eslint/no-restricted-imports": "off",
815
- // disabled like js
816
824
  "@typescript-eslint/no-restricted-types": "off",
817
825
  // allow all types
818
- "@typescript-eslint/no-shadow": "error",
819
826
  "@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
820
827
  "@typescript-eslint/no-unnecessary-qualifier": "error",
821
828
  "@typescript-eslint/no-unsafe-type-assertion": "off",
822
829
  // too strict
823
- "@typescript-eslint/no-use-before-define": "error",
824
830
  "@typescript-eslint/no-useless-empty-export": "error",
825
831
  "@typescript-eslint/parameter-properties": ["error", { prefer: "parameter-property" }],
826
- "@typescript-eslint/prefer-destructuring": [
827
- "error",
828
- {
829
- AssignmentExpression: { array: true, object: false },
830
- VariableDeclarator: { array: false, object: true }
831
- },
832
- { enforceForRenamedProperties: false }
833
- ],
834
832
  "@typescript-eslint/prefer-enum-initializers": "error",
835
833
  "@typescript-eslint/prefer-readonly": "error",
836
834
  "@typescript-eslint/prefer-readonly-parameter-types": "off",
@@ -840,21 +838,8 @@ var tsStrict = pluginTs9.config(
840
838
  "@typescript-eslint/strict-boolean-expressions": "off",
841
839
  // too strict
842
840
  "@typescript-eslint/switch-exhaustiveness-check": "error",
843
- "@typescript-eslint/typedef": "off",
841
+ "@typescript-eslint/typedef": "off"
844
842
  // disabled for use strict tsc
845
- "class-methods-use-this": "off",
846
- "default-param-last": "off",
847
- "init-declarations": "off",
848
- "max-params": "off",
849
- "no-dupe-class-members": "off",
850
- "no-invalid-this": "off",
851
- "no-loop-func": "off",
852
- "no-magic-numbers": "off",
853
- "no-redeclare": "off",
854
- "no-restricted-imports": "off",
855
- "no-shadow": "off",
856
- "no-use-before-define": "off",
857
- "prefer-destructuring": "off"
858
843
  }
859
844
  }
860
845
  );
@@ -864,7 +849,7 @@ function ts({
864
849
  strict = true,
865
850
  ...config
866
851
  }) {
867
- return pluginTs9.config(
852
+ return pluginTs4.config(
868
853
  parserOptions ? {
869
854
  languageOptions: {
870
855
  parserOptions: {
@@ -877,7 +862,7 @@ function ts({
877
862
  config,
878
863
  disableTypeChecked ? {
879
864
  extends: [
880
- pluginTs9.configs.disableTypeChecked,
865
+ pluginTs4.configs.disableTypeChecked,
881
866
  // disabled unsafe rules for js files
882
867
  {
883
868
  rules: {
@@ -901,8 +886,8 @@ function ts({
901
886
 
902
887
  // src/configs/unused-imports.ts
903
888
  import pluginUnusedImports from "eslint-plugin-unused-imports";
904
- import pluginTs10 from "typescript-eslint";
905
- var unusedImportsStrict = pluginTs10.config({
889
+ var jsStrictRules2 = jsStrict.rules ?? {};
890
+ var unusedImportsStrict = mergeRules({
906
891
  plugins: {
907
892
  "unused-imports": pluginUnusedImports
908
893
  },
@@ -910,82 +895,72 @@ var unusedImportsStrict = pluginTs10.config({
910
895
  "@typescript-eslint/no-unused-vars": "off",
911
896
  "no-unused-vars": "off",
912
897
  "unused-imports/no-unused-imports": "error",
913
- "unused-imports/no-unused-vars": [
914
- "warn",
915
- {
916
- argsIgnorePattern: "^_",
917
- caughtErrorsIgnorePattern: "^_",
918
- ignoreRestSiblings: true,
919
- varsIgnorePattern: "^_"
920
- }
921
- ]
898
+ "unused-imports/no-unused-vars": jsStrictRules2["no-unused-vars"]
922
899
  }
923
900
  });
924
901
 
925
902
  // src/configs/vitest.ts
926
903
  import pluginVitest from "@vitest/eslint-plugin";
927
- import pluginTs11 from "typescript-eslint";
928
- var vitestStrict = pluginTs11.config(pluginVitest.configs.recommended, {
929
- rules: {
930
- "vitest/consistent-test-filename": "off",
931
- "vitest/consistent-test-it": "error",
932
- "vitest/max-expects": "off",
933
- "vitest/max-nested-describe": "off",
934
- "vitest/no-alias-methods": "error",
935
- "vitest/no-conditional-expect": "error",
936
- "vitest/no-conditional-in-test": "error",
937
- "vitest/no-conditional-tests": "error",
938
- "vitest/no-disabled-tests": "off",
939
- "vitest/no-done-callback": "off",
940
- // deprecated
941
- "vitest/no-duplicate-hooks": "error",
942
- "vitest/no-focused-tests": "off",
943
- "vitest/no-hooks": "off",
944
- "vitest/no-interpolation-in-snapshots": "error",
945
- "vitest/no-large-snapshots": "off",
946
- "vitest/no-mocks-import": "off",
947
- "vitest/no-restricted-matchers": "off",
948
- "vitest/no-restricted-vi-methods": "off",
949
- "vitest/no-standalone-expect": "error",
950
- "vitest/no-test-prefixes": "off",
951
- "vitest/no-test-return-statement": "error",
952
- "vitest/padding-around-after-all-blocks": "error",
953
- "vitest/padding-around-after-each-blocks": "error",
954
- "vitest/padding-around-all": "error",
955
- "vitest/padding-around-before-all-blocks": "error",
956
- "vitest/padding-around-before-each-blocks": "error",
957
- "vitest/padding-around-describe-blocks": "error",
958
- "vitest/padding-around-expect-groups": "error",
959
- "vitest/padding-around-test-blocks": "error",
960
- "vitest/prefer-called-with": "error",
961
- "vitest/prefer-comparison-matcher": "error",
962
- "vitest/prefer-each": "error",
963
- "vitest/prefer-equality-matcher": "error",
964
- "vitest/prefer-expect-assertions": "error",
965
- "vitest/prefer-expect-resolves": "error",
966
- "vitest/prefer-hooks-in-order": "error",
967
- "vitest/prefer-hooks-on-top": "error",
968
- "vitest/prefer-lowercase-title": "error",
969
- "vitest/prefer-mock-promise-shorthand": "error",
970
- "vitest/prefer-snapshot-hint": "error",
971
- "vitest/prefer-spy-on": "error",
972
- "vitest/prefer-strict-equal": "error",
973
- "vitest/prefer-to-be": "error",
974
- "vitest/prefer-to-be-falsy": "error",
975
- "vitest/prefer-to-be-object": "error",
976
- "vitest/prefer-to-be-truthy": "error",
977
- "vitest/prefer-to-contain": "error",
978
- "vitest/prefer-to-have-length": "error",
979
- "vitest/prefer-todo": "error",
980
- "vitest/prefer-vi-mocked": "error",
981
- "vitest/require-hook": "error",
982
- "vitest/require-to-throw-message": "error",
983
- "vitest/require-top-level-describe": "error",
984
- "vitest/valid-expect-in-promise": "error"
985
- }
904
+ import pluginTs5 from "typescript-eslint";
905
+ var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
906
+ "vitest/consistent-test-filename": "off",
907
+ "vitest/consistent-test-it": "error",
908
+ "vitest/max-expects": "off",
909
+ "vitest/max-nested-describe": "off",
910
+ "vitest/no-alias-methods": "error",
911
+ "vitest/no-conditional-expect": "error",
912
+ "vitest/no-conditional-in-test": "error",
913
+ "vitest/no-conditional-tests": "error",
914
+ "vitest/no-disabled-tests": "off",
915
+ "vitest/no-done-callback": "off",
916
+ // deprecated
917
+ "vitest/no-duplicate-hooks": "error",
918
+ "vitest/no-focused-tests": "off",
919
+ "vitest/no-hooks": "off",
920
+ "vitest/no-interpolation-in-snapshots": "error",
921
+ "vitest/no-large-snapshots": "off",
922
+ "vitest/no-mocks-import": "off",
923
+ "vitest/no-restricted-matchers": "off",
924
+ "vitest/no-restricted-vi-methods": "off",
925
+ "vitest/no-standalone-expect": "error",
926
+ "vitest/no-test-prefixes": "off",
927
+ "vitest/no-test-return-statement": "error",
928
+ "vitest/padding-around-after-all-blocks": "error",
929
+ "vitest/padding-around-after-each-blocks": "error",
930
+ "vitest/padding-around-all": "error",
931
+ "vitest/padding-around-before-all-blocks": "error",
932
+ "vitest/padding-around-before-each-blocks": "error",
933
+ "vitest/padding-around-describe-blocks": "error",
934
+ "vitest/padding-around-expect-groups": "error",
935
+ "vitest/padding-around-test-blocks": "error",
936
+ "vitest/prefer-called-with": "error",
937
+ "vitest/prefer-comparison-matcher": "error",
938
+ "vitest/prefer-each": "error",
939
+ "vitest/prefer-equality-matcher": "error",
940
+ "vitest/prefer-expect-assertions": "error",
941
+ "vitest/prefer-expect-resolves": "error",
942
+ "vitest/prefer-hooks-in-order": "error",
943
+ "vitest/prefer-hooks-on-top": "error",
944
+ "vitest/prefer-lowercase-title": "error",
945
+ "vitest/prefer-mock-promise-shorthand": "error",
946
+ "vitest/prefer-snapshot-hint": "error",
947
+ "vitest/prefer-spy-on": "error",
948
+ "vitest/prefer-strict-equal": "error",
949
+ "vitest/prefer-to-be": "error",
950
+ "vitest/prefer-to-be-falsy": "error",
951
+ "vitest/prefer-to-be-object": "error",
952
+ "vitest/prefer-to-be-truthy": "error",
953
+ "vitest/prefer-to-contain": "error",
954
+ "vitest/prefer-to-have-length": "error",
955
+ "vitest/prefer-todo": "error",
956
+ "vitest/prefer-vi-mocked": "error",
957
+ "vitest/require-hook": "error",
958
+ "vitest/require-to-throw-message": "error",
959
+ "vitest/require-top-level-describe": "error",
960
+ "vitest/valid-expect-in-promise": "error"
986
961
  });
987
962
  function vitest(config) {
988
- return pluginTs11.config({
963
+ return pluginTs5.config({
989
964
  extends: [vitestStrict, config],
990
965
  files: ["tests/**", "*.test.*"]
991
966
  });
@@ -993,8 +968,7 @@ function vitest(config) {
993
968
 
994
969
  // src/configs/unicorn.ts
995
970
  import pluginUnicorn from "eslint-plugin-unicorn";
996
- import pluginTs12 from "typescript-eslint";
997
- var unicornRecommended = pluginTs12.config(
971
+ var unicornRecommended = mergeRules(
998
972
  {
999
973
  ...pluginUnicorn.configs["flat/recommended"],
1000
974
  rules: Object.fromEntries(
@@ -1004,73 +978,71 @@ var unicornRecommended = pluginTs12.config(
1004
978
  )
1005
979
  },
1006
980
  {
1007
- rules: {
1008
- "no-negated-condition": "off",
1009
- "no-nested-ternary": "off",
1010
- "unicorn/better-regex": "off",
1011
- // not recommended
1012
- "unicorn/catch-error-name": "off",
1013
- // overcorrection
1014
- "unicorn/consistent-destructuring": "off",
1015
- "unicorn/custom-error-definition": "off",
1016
- "unicorn/expiring-todo-comments": "off",
1017
- // discarded
1018
- "unicorn/filename-case": "off",
1019
- // discarded
1020
- "unicorn/no-abusive-eslint-disable": "off",
1021
- // disabled for use eslint-comments/no-unlimited-disable
1022
- "unicorn/no-anonymous-default-export": "off",
1023
- // disabled for use import/no-anonymous-default-export
1024
- "unicorn/no-array-for-each": "off",
1025
- // disallow for-of
1026
- "unicorn/no-array-reduce": "off",
1027
- // allow array reduce
1028
- "unicorn/no-console-spaces": "off",
1029
- // discarded
1030
- "unicorn/no-for-loop": "off",
1031
- // disallow for-of
1032
- "unicorn/no-keyword-prefix": "error",
1033
- "unicorn/no-magic-array-flat-depth": "off",
1034
- // allow magic numbers
1035
- "unicorn/no-null": "off",
1036
- // allow null
1037
- "unicorn/no-typeof-undefined": "off",
1038
- // discarded
1039
- "unicorn/no-unnecessary-polyfills": "off",
1040
- // skip validate polyfills
1041
- "unicorn/no-unused-properties": "off",
1042
- // not recommended
1043
- "unicorn/numeric-separators-style": "off",
1044
- // disabled style rules
1045
- "unicorn/prefer-global-this": "off",
1046
- // discarded
1047
- "unicorn/prefer-json-parse-buffer": "off",
1048
- // not recommended
1049
- "unicorn/prefer-keyboard-event-key": "off",
1050
- // allow keyCode
1051
- "unicorn/prefer-node-protocol": "off",
1052
- // disabled for use import/enforce-node-protocol-usage
1053
- "unicorn/prefer-string-raw": "off",
1054
- // disallow String.raw
1055
- "unicorn/prefer-structured-clone": "off",
1056
- // disallow structuredClone
1057
- "unicorn/prefer-switch": "off",
1058
- // discarded
1059
- "unicorn/prefer-ternary": "off",
1060
- // discarded
1061
- "unicorn/prefer-top-level-await": "off",
1062
- // discarded
1063
- "unicorn/prefer-type-error": "off",
1064
- // discarded
1065
- "unicorn/prevent-abbreviations": "off",
1066
- // disabled style rules
1067
- "unicorn/relative-url-style": ["error", "always"],
1068
- "unicorn/require-post-message-target-origin": "off",
1069
- // not recommended
1070
- "unicorn/string-content": "off",
1071
- // not recommended
1072
- "unicorn/switch-case-braces": ["error", "avoid"]
1073
- }
981
+ "no-negated-condition": "off",
982
+ "no-nested-ternary": "off",
983
+ "unicorn/better-regex": "off",
984
+ // not recommended
985
+ "unicorn/catch-error-name": "off",
986
+ // overcorrection
987
+ "unicorn/consistent-destructuring": "off",
988
+ "unicorn/custom-error-definition": "off",
989
+ "unicorn/expiring-todo-comments": "off",
990
+ // discarded
991
+ "unicorn/filename-case": "off",
992
+ // discarded
993
+ "unicorn/no-abusive-eslint-disable": "off",
994
+ // disabled for use eslint-comments/no-unlimited-disable
995
+ "unicorn/no-anonymous-default-export": "off",
996
+ // disabled for use import/no-anonymous-default-export
997
+ "unicorn/no-array-for-each": "off",
998
+ // disallow for-of
999
+ "unicorn/no-array-reduce": "off",
1000
+ // allow array reduce
1001
+ "unicorn/no-console-spaces": "off",
1002
+ // discarded
1003
+ "unicorn/no-for-loop": "off",
1004
+ // disallow for-of
1005
+ "unicorn/no-keyword-prefix": "error",
1006
+ "unicorn/no-magic-array-flat-depth": "off",
1007
+ // allow magic numbers
1008
+ "unicorn/no-null": "off",
1009
+ // allow null
1010
+ "unicorn/no-typeof-undefined": "off",
1011
+ // discarded
1012
+ "unicorn/no-unnecessary-polyfills": "off",
1013
+ // skip validate polyfills
1014
+ "unicorn/no-unused-properties": "off",
1015
+ // not recommended
1016
+ "unicorn/numeric-separators-style": "off",
1017
+ // disabled style rules
1018
+ "unicorn/prefer-global-this": "off",
1019
+ // discarded
1020
+ "unicorn/prefer-json-parse-buffer": "off",
1021
+ // not recommended
1022
+ "unicorn/prefer-keyboard-event-key": "off",
1023
+ // allow keyCode
1024
+ "unicorn/prefer-node-protocol": "off",
1025
+ // disabled for use import/enforce-node-protocol-usage
1026
+ "unicorn/prefer-string-raw": "off",
1027
+ // disallow String.raw
1028
+ "unicorn/prefer-structured-clone": "off",
1029
+ // disallow structuredClone
1030
+ "unicorn/prefer-switch": "off",
1031
+ // discarded
1032
+ "unicorn/prefer-ternary": "off",
1033
+ // discarded
1034
+ "unicorn/prefer-top-level-await": "off",
1035
+ // discarded
1036
+ "unicorn/prefer-type-error": "off",
1037
+ // discarded
1038
+ "unicorn/prevent-abbreviations": "off",
1039
+ // disabled style rules
1040
+ "unicorn/relative-url-style": ["error", "always"],
1041
+ "unicorn/require-post-message-target-origin": "off",
1042
+ // not recommended
1043
+ "unicorn/string-content": "off",
1044
+ // not recommended
1045
+ "unicorn/switch-case-braces": ["error", "avoid"]
1074
1046
  }
1075
1047
  );
1076
1048
 
@@ -1088,7 +1060,7 @@ function defineBaseConfig({
1088
1060
  vitest: vitestOptions = {},
1089
1061
  ...config
1090
1062
  } = {}) {
1091
- return pluginTs13.config(
1063
+ return pluginTs6.config(
1092
1064
  settings ? { settings } : {},
1093
1065
  ignores ? { ignores } : {},
1094
1066
  jsOptions ? js(jsOptions) : {},
@@ -1105,7 +1077,7 @@ function defineBaseConfig({
1105
1077
 
1106
1078
  // src/react.ts
1107
1079
  import pluginReact2 from "eslint-plugin-react";
1108
- import pluginTs14 from "typescript-eslint";
1080
+ import pluginTs7 from "typescript-eslint";
1109
1081
  function defineReactConfig({
1110
1082
  jsxA11y: enabledJsxA11y = true,
1111
1083
  jsxRuntime: enabledJsxRuntime = true,
@@ -1113,7 +1085,7 @@ function defineReactConfig({
1113
1085
  reactRefresh: enabledReactRefresh = true,
1114
1086
  ...reactOptions
1115
1087
  } = {}) {
1116
- return pluginTs14.config(
1088
+ return pluginTs7.config(
1117
1089
  react({
1118
1090
  ...reactOptions,
1119
1091
  extends: [