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