@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.
- package/dist/index.js +748 -776
- package/dist/index.mjs +748 -776
- 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
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
52
|
-
var importsStrict =
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
|
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
|
|
237
|
-
var jsStrict =
|
|
242
|
+
var import_typescript_eslint2 = __toESM(require("typescript-eslint"));
|
|
243
|
+
var jsStrict = mergeRules(
|
|
238
244
|
import_js.default.configs.recommended,
|
|
239
245
|
{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
"
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
"
|
|
381
|
-
|
|
382
|
-
{
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
"
|
|
430
|
-
|
|
431
|
-
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
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
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
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
|
-
|
|
536
|
-
"perfectionist/sort-imports"
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
"perfectionist/sort-jsx-props"
|
|
559
|
-
|
|
560
|
-
{
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"perfectionist/sort-union-types"
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
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
|
-
|
|
578
|
-
|
|
579
|
-
|
|
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
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
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
|
|
615
|
-
var reactStrict =
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
"
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
"
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
"
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
"
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
"
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
773
|
-
var
|
|
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
|
-
|
|
777
|
-
|
|
778
|
-
"
|
|
779
|
-
|
|
780
|
-
|
|
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
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
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 =
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
941
|
-
var unusedImportsStrict =
|
|
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
|
|
964
|
-
var vitestStrict =
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
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
|
|
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
|
|
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
|
|
1124
|
+
return import_typescript_eslint7.default.config(
|
|
1153
1125
|
react({
|
|
1154
1126
|
...reactOptions,
|
|
1155
1127
|
extends: [
|