@oxlint/migrate 1.40.0 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -10
- package/dist/bin/oxlint-migrate.mjs +22 -2
- package/dist/src/index.d.mts +5 -0
- package/dist/src/index.mjs +1 -1
- package/dist/{src-pmJg5CKN.mjs → src-BiX8O61Z.mjs} +446 -416
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@oxlint/migrate)
|
|
5
5
|
[](https://www.npmjs.com/package/@oxlint/migrate)
|
|
6
6
|
|
|
7
|
-
Generates a `.oxlintrc.json` from an existing
|
|
7
|
+
Generates a `.oxlintrc.json` from an existing ESLint flat config.
|
|
8
|
+
|
|
9
|
+
See [the Migration Guide in the Oxlint docs](https://oxc.rs/docs/guide/usage/linter/migrate-from-eslint.html) for more information on migrating from ESLint to Oxlint.
|
|
8
10
|
|
|
9
11
|
## Usage
|
|
10
12
|
|
|
@@ -12,32 +14,32 @@ Generates a `.oxlintrc.json` from an existing eslint flat config.
|
|
|
12
14
|
npx @oxlint/migrate <optional-eslint-flat-config-path>
|
|
13
15
|
```
|
|
14
16
|
|
|
15
|
-
When no config file provided, the script searches for the default
|
|
17
|
+
When no config file is provided, the script searches for the default ESLint config filenames in the current directory.
|
|
16
18
|
|
|
17
19
|
### Options
|
|
18
20
|
|
|
19
21
|
| Options | Description |
|
|
20
22
|
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
-
| `--merge` | \* merge
|
|
22
|
-
| `--type-aware` | Include type aware rules, which are supported with `oxlint --type-aware`
|
|
23
|
+
| `--merge` | \* merge ESLint configuration with an existing .oxlintrc.json configuration |
|
|
24
|
+
| `--type-aware` | Include type aware rules, which are supported with `oxlint --type-aware` and [oxlint-tsgolint](https://github.com/oxc-project/tsgolint) |
|
|
23
25
|
| `--with-nursery` | Include oxlint rules which are currently under development |
|
|
24
26
|
| `--js-plugins` | \*\* Include ESLint plugins via `jsPlugins` key. |
|
|
25
|
-
| `--output-file <file>` | The oxlint configuration file where
|
|
26
|
-
| `--replace-eslint-comments` | Search in the project files for
|
|
27
|
+
| `--output-file <file>` | The oxlint configuration file where ESLint v9 rules will be written to, default: `.oxlintrc.json` |
|
|
28
|
+
| `--replace-eslint-comments` | Search in the project files for ESLint comments and replaces them with oxlint. Some ESLint comments are not supported and will be reported. |
|
|
27
29
|
|
|
28
30
|
\* WARNING: When some `categories` are enabled, this tools will enable more rules with the combination of `plugins`.
|
|
29
|
-
Else we need to disable each rule `plugin/categories` combination, which is not covered by your
|
|
31
|
+
Else we need to disable each rule `plugin/categories` combination, which is not covered by your ESLint configuration.
|
|
30
32
|
This behavior can change in the future.
|
|
31
33
|
|
|
32
|
-
\*\* WARNING: Tries to guess the plugin name. Should work with most
|
|
34
|
+
\*\* WARNING: Tries to guess the plugin name. Should work fine with most plugin names, but is not perfect.
|
|
33
35
|
Not every ESLint API is integrated with `oxlint`.
|
|
34
|
-
Tested ESLint Plugins with `oxlint` can be found in this [Oxc Discussion](https://github.com/oxc-project/oxc/discussions/14862).
|
|
36
|
+
Tested ESLint Plugins with `oxlint` can be found in this [Oxc Discussion](https://github.com/oxc-project/oxc/discussions/14862). See the caveats section for more details.
|
|
35
37
|
|
|
36
38
|
### User Flow
|
|
37
39
|
|
|
38
40
|
- Upgrade `oxlint` and `@oxlint/migrate` to the same version.
|
|
39
41
|
- Execute `npx @oxlint/migrate`
|
|
40
|
-
- (Optional): Disable supported rules via [eslint-plugin-oxlint](https://github.com/oxc-project/eslint-plugin-oxlint)
|
|
42
|
+
- (Optional): Disable supported rules via [eslint-plugin-oxlint](https://github.com/oxc-project/eslint-plugin-oxlint), if you have any rules you need that aren't in Oxlint yet.
|
|
41
43
|
|
|
42
44
|
### TypeScript ESLint Configuration Files
|
|
43
45
|
|
|
@@ -66,3 +68,64 @@ pnpm vitest
|
|
|
66
68
|
```shell
|
|
67
69
|
pnpm manual-test
|
|
68
70
|
```
|
|
71
|
+
|
|
72
|
+
## Caveats
|
|
73
|
+
|
|
74
|
+
The migration tool has been tested to work quite well for simple ESLint flat config files. It has also been tested to work correctly for the large majority of complex flat config files. However, there may be some edge cases where the migration is not perfect, or the behavior of Oxlint itself differs from ESLint.
|
|
75
|
+
|
|
76
|
+
Here are some known caveats to be aware of:
|
|
77
|
+
|
|
78
|
+
**`settings` field not migrated**
|
|
79
|
+
|
|
80
|
+
The `settings` field (e.g. for setting the React version) is not migrated to the oxlint config yet. You may need to copy it over manually if you have any settings specified.
|
|
81
|
+
|
|
82
|
+
Not all `settings` options are supported by oxlint, and so rule behavior in certain edge-cases may differ. See [the Settings docs](https://oxc.rs/docs/guide/usage/linter/config-file-reference.html#settings) for more info.
|
|
83
|
+
|
|
84
|
+
**Local ESLint Plugins imported via path are not migrated**
|
|
85
|
+
|
|
86
|
+
The `--js-plugins` flag cannot migrate ESLint plugins from file paths in the same repo currently (e.g. if you have `../eslint-plugin-myplugin` in your `eslint.config.mjs`). You will need to copy them over into the `jsPlugins` manually. See [the JS Plugins docs]() for more info.
|
|
87
|
+
|
|
88
|
+
**`globals` field with large number of values**
|
|
89
|
+
|
|
90
|
+
If you end up with a very large list of values for the `globals` field, it's likely because your version of the `globals` npm package is older (or newer!) than the one used in `@oxlint/migrate`.
|
|
91
|
+
|
|
92
|
+
You can generally fix this by updating the `globals` package to the latest version so we can recognize the relevant globals and handle it as a simple `env` field.
|
|
93
|
+
|
|
94
|
+
For example, this is a good `.oxlintrc.json` and means the globals used by your ESLint config were recognized:
|
|
95
|
+
|
|
96
|
+
```jsonc
|
|
97
|
+
{
|
|
98
|
+
"env": {
|
|
99
|
+
"browser": true,
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
And this is bad:
|
|
105
|
+
|
|
106
|
+
```jsonc
|
|
107
|
+
{
|
|
108
|
+
"globals": {
|
|
109
|
+
"window": "readonly",
|
|
110
|
+
"document": "readonly",
|
|
111
|
+
"navigator": "readonly",
|
|
112
|
+
// ...and a few hundred more
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Oxlint can potentially lint more files by default**
|
|
118
|
+
|
|
119
|
+
If you extend certain ESLint configs (e.g. the airbnb config), they can disable many - or even all - rules for specific files or file types. And this is not always obvious to the end-user.
|
|
120
|
+
|
|
121
|
+
Depending on how this is implemented by the given config, these behaviors may not migrate to your Oxlint config. If you see certain files that you do not want to run Oxlint on which the migrator did not handle, you can add the relevant patterns to the `ignorePatterns` field in `.oxlintrc.json`.
|
|
122
|
+
|
|
123
|
+
**Not all ESLint plugins will work with JS Plugins**
|
|
124
|
+
|
|
125
|
+
The JS Plugins API supports almost all ESLint v9+ plugins for linting JS/TS/JSX/TSX files, but there are still some minor holes in support. See the [JS Plugins documentation](https://oxc.rs/docs/guide/usage/linter/js-plugins.html) for specifics.
|
|
126
|
+
|
|
127
|
+
For example, if you currently use `eslint-plugin-prettier`, it will not work as a JS Plugin, as we do not support custom parsers for JS Plugins. To replace the functionality of `eslint-plugin-prettier`, you can use `prettier --check` in CI and/or your git pre-commit hooks to ensure code formatting is enforced.
|
|
128
|
+
|
|
129
|
+
You could also consider [replacing Prettier with Oxfmt](https://oxc.rs/docs/guide/usage/formatter/migrate-from-prettier.html).
|
|
130
|
+
|
|
131
|
+
Note that `eslint-config-prettier` is different from the prettier plugin, and _will_ be migrated fine, as it's just a config to disable formatting-related ESLint rules, not an actual plugin.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as rules_exports, n as preFixForJsPlugins, r as nurseryRules, t as src_default } from "../src-
|
|
2
|
+
import { i as rules_exports, n as preFixForJsPlugins, r as nurseryRules, t as src_default } from "../src-BiX8O61Z.mjs";
|
|
3
3
|
import { program } from "commander";
|
|
4
4
|
import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -40,7 +40,7 @@ const loadESLintConfig = async (filePath) => {
|
|
|
40
40
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region package.json
|
|
43
|
-
var version = "1.
|
|
43
|
+
var version = "1.42.0";
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/walker/comments/replaceRuleDirectiveComment.ts
|
|
@@ -282,6 +282,11 @@ const getAllProjectFiles = () => {
|
|
|
282
282
|
//#region src/reporter.ts
|
|
283
283
|
var DefaultReporter = class {
|
|
284
284
|
reports = /* @__PURE__ */ new Set();
|
|
285
|
+
skippedRules = new Map([
|
|
286
|
+
["nursery", /* @__PURE__ */ new Set()],
|
|
287
|
+
["type-aware", /* @__PURE__ */ new Set()],
|
|
288
|
+
["unsupported", /* @__PURE__ */ new Set()]
|
|
289
|
+
]);
|
|
285
290
|
report(message) {
|
|
286
291
|
this.reports.add(message);
|
|
287
292
|
}
|
|
@@ -291,6 +296,21 @@ var DefaultReporter = class {
|
|
|
291
296
|
getReports() {
|
|
292
297
|
return Array.from(this.reports);
|
|
293
298
|
}
|
|
299
|
+
markSkipped(rule, category) {
|
|
300
|
+
this.skippedRules.get(category)?.add(rule);
|
|
301
|
+
}
|
|
302
|
+
removeSkipped(rule, category) {
|
|
303
|
+
this.skippedRules.get(category)?.delete(rule);
|
|
304
|
+
}
|
|
305
|
+
getSkippedRulesByCategory() {
|
|
306
|
+
const result = {
|
|
307
|
+
nursery: [],
|
|
308
|
+
"type-aware": [],
|
|
309
|
+
unsupported: []
|
|
310
|
+
};
|
|
311
|
+
for (const [category, rules] of this.skippedRules) result[category] = Array.from(rules);
|
|
312
|
+
return result;
|
|
313
|
+
}
|
|
294
314
|
};
|
|
295
315
|
|
|
296
316
|
//#endregion
|
package/dist/src/index.d.mts
CHANGED
|
@@ -26,10 +26,15 @@ type OxlintConfig = {
|
|
|
26
26
|
overrides?: OxlintConfigOverride[];
|
|
27
27
|
ignorePatterns?: OxlintConfigIgnorePatterns;
|
|
28
28
|
};
|
|
29
|
+
type RuleSkippedCategory = 'nursery' | 'type-aware' | 'unsupported';
|
|
30
|
+
type SkippedCategoryGroup = Record<RuleSkippedCategory, string[]>;
|
|
29
31
|
type Reporter = {
|
|
30
32
|
report(message: string): void;
|
|
31
33
|
remove(message: string): void;
|
|
32
34
|
getReports(): string[];
|
|
35
|
+
markSkipped(rule: string, category: RuleSkippedCategory): void;
|
|
36
|
+
removeSkipped(rule: string, category: RuleSkippedCategory): void;
|
|
37
|
+
getSkippedRulesByCategory(): SkippedCategoryGroup;
|
|
33
38
|
};
|
|
34
39
|
type Options = {
|
|
35
40
|
reporter?: Reporter;
|
package/dist/src/index.mjs
CHANGED
|
@@ -178,135 +178,25 @@ var rules_exports = /* @__PURE__ */ __exportAll({
|
|
|
178
178
|
styleRules: () => styleRules,
|
|
179
179
|
suspiciousRules: () => suspiciousRules
|
|
180
180
|
});
|
|
181
|
-
const pedanticRules = [
|
|
182
|
-
"accessor-pairs",
|
|
183
|
-
"array-callback-return",
|
|
184
|
-
"eqeqeq",
|
|
185
|
-
"max-classes-per-file",
|
|
186
|
-
"max-depth",
|
|
187
|
-
"max-lines-per-function",
|
|
188
|
-
"max-lines",
|
|
189
|
-
"max-nested-callbacks",
|
|
190
|
-
"no-inline-comments",
|
|
191
|
-
"no-loop-func",
|
|
192
|
-
"no-array-constructor",
|
|
193
|
-
"no-case-declarations",
|
|
194
|
-
"no-lonely-if",
|
|
195
|
-
"no-object-constructor",
|
|
196
|
-
"no-constructor-return",
|
|
197
|
-
"no-else-return",
|
|
198
|
-
"no-fallthrough",
|
|
199
|
-
"no-inner-declarations",
|
|
200
|
-
"no-negated-condition",
|
|
201
|
-
"no-new-wrappers",
|
|
202
|
-
"no-promise-executor-return",
|
|
203
|
-
"no-prototype-builtins",
|
|
204
|
-
"no-redeclare",
|
|
205
|
-
"no-self-compare",
|
|
206
|
-
"no-throw-literal",
|
|
207
|
-
"no-useless-return",
|
|
208
|
-
"no-warning-comments",
|
|
209
|
-
"radix",
|
|
210
|
-
"require-await",
|
|
211
|
-
"sort-vars",
|
|
212
|
-
"symbol-description",
|
|
213
|
-
"import/max-dependencies",
|
|
214
|
-
"jest/no-conditional-in-test",
|
|
215
|
-
"jsdoc/require-param",
|
|
216
|
-
"jsdoc/require-param-description",
|
|
217
|
-
"jsdoc/require-param-name",
|
|
218
|
-
"jsdoc/require-param-type",
|
|
219
|
-
"jsdoc/require-returns",
|
|
220
|
-
"jsdoc/require-returns-description",
|
|
221
|
-
"jsdoc/require-returns-type",
|
|
222
|
-
"react/checked-requires-onchange-or-readonly",
|
|
223
|
-
"react/jsx-no-target-blank",
|
|
224
|
-
"react/jsx-no-useless-fragment",
|
|
225
|
-
"react/no-unescaped-entities",
|
|
226
|
-
"react-hooks/rules-of-hooks",
|
|
227
|
-
"@typescript-eslint/ban-ts-comment",
|
|
228
|
-
"@typescript-eslint/ban-types",
|
|
229
|
-
"@typescript-eslint/no-misused-promises",
|
|
230
|
-
"@typescript-eslint/no-confusing-void-expression",
|
|
231
|
-
"@typescript-eslint/no-deprecated",
|
|
232
|
-
"@typescript-eslint/no-mixed-enums",
|
|
233
|
-
"@typescript-eslint/no-unsafe-argument",
|
|
234
|
-
"@typescript-eslint/no-unsafe-assignment",
|
|
235
|
-
"@typescript-eslint/no-unsafe-call",
|
|
236
|
-
"@typescript-eslint/no-unsafe-function-type",
|
|
237
|
-
"@typescript-eslint/no-unsafe-member-access",
|
|
238
|
-
"@typescript-eslint/no-unsafe-return",
|
|
239
|
-
"@typescript-eslint/only-throw-error",
|
|
240
|
-
"@typescript-eslint/prefer-enum-initializers",
|
|
241
|
-
"@typescript-eslint/prefer-includes",
|
|
242
|
-
"@typescript-eslint/prefer-nullish-coalescing",
|
|
243
|
-
"@typescript-eslint/prefer-promise-reject-errors",
|
|
244
|
-
"@typescript-eslint/prefer-ts-expect-error",
|
|
245
|
-
"@typescript-eslint/related-getter-setter-pairs",
|
|
246
|
-
"@typescript-eslint/require-await",
|
|
247
|
-
"@typescript-eslint/restrict-plus-operands",
|
|
248
|
-
"@typescript-eslint/return-await",
|
|
249
|
-
"@typescript-eslint/strict-boolean-expressions",
|
|
250
|
-
"@typescript-eslint/switch-exhaustiveness-check",
|
|
251
|
-
"unicorn/consistent-assert",
|
|
252
|
-
"unicorn/consistent-empty-array-spread",
|
|
253
|
-
"unicorn/escape-case",
|
|
254
|
-
"unicorn/explicit-length-check",
|
|
255
|
-
"unicorn/new-for-builtins",
|
|
256
|
-
"unicorn/no-immediate-mutation",
|
|
257
|
-
"unicorn/no-unnecessary-array-splice-count",
|
|
258
|
-
"unicorn/no-array-callback-reference",
|
|
259
|
-
"unicorn/no-unnecessary-array-flat-depth",
|
|
260
|
-
"unicorn/no-unnecessary-slice-end",
|
|
261
|
-
"unicorn/no-hex-escape",
|
|
262
|
-
"unicorn/no-instanceof-array",
|
|
263
|
-
"unicorn/no-lonely-if",
|
|
264
|
-
"unicorn/no-negation-in-equality-check",
|
|
265
|
-
"unicorn/no-new-buffer",
|
|
266
|
-
"unicorn/no-object-as-default-parameter",
|
|
267
|
-
"unicorn/no-static-only-class",
|
|
268
|
-
"unicorn/no-this-assignment",
|
|
269
|
-
"unicorn/no-typeof-undefined",
|
|
270
|
-
"unicorn/no-unreadable-iife",
|
|
271
|
-
"unicorn/no-useless-promise-resolve-reject",
|
|
272
|
-
"unicorn/no-useless-switch-case",
|
|
273
|
-
"unicorn/no-useless-undefined",
|
|
274
|
-
"unicorn/prefer-top-level-await",
|
|
275
|
-
"unicorn/prefer-at",
|
|
276
|
-
"unicorn/prefer-array-flat",
|
|
277
|
-
"unicorn/prefer-array-some",
|
|
278
|
-
"unicorn/prefer-blob-reading-methods",
|
|
279
|
-
"unicorn/prefer-code-point",
|
|
280
|
-
"unicorn/prefer-date-now",
|
|
281
|
-
"unicorn/prefer-dom-node-append",
|
|
282
|
-
"unicorn/prefer-dom-node-dataset",
|
|
283
|
-
"unicorn/prefer-dom-node-remove",
|
|
284
|
-
"unicorn/prefer-event-target",
|
|
285
|
-
"unicorn/prefer-math-min-max",
|
|
286
|
-
"unicorn/prefer-math-trunc",
|
|
287
|
-
"unicorn/prefer-native-coercion-functions",
|
|
288
|
-
"unicorn/prefer-prototype-methods",
|
|
289
|
-
"unicorn/prefer-query-selector",
|
|
290
|
-
"unicorn/prefer-regexp-test",
|
|
291
|
-
"unicorn/prefer-string-replace-all",
|
|
292
|
-
"unicorn/prefer-string-slice",
|
|
293
|
-
"unicorn/prefer-type-error",
|
|
294
|
-
"unicorn/require-number-to-fixed-digits-argument",
|
|
295
|
-
"@typescript-eslint/no-loop-func",
|
|
296
|
-
"@typescript-eslint/no-array-constructor",
|
|
297
|
-
"unicorn/no-negated-condition",
|
|
298
|
-
"@typescript-eslint/no-redeclare",
|
|
299
|
-
"import-x/max-dependencies",
|
|
300
|
-
"vitest/no-conditional-in-test"
|
|
301
|
-
];
|
|
302
181
|
const styleRules = [
|
|
182
|
+
"import/consistent-type-specifier-style",
|
|
183
|
+
"import/exports-last",
|
|
184
|
+
"import/first",
|
|
185
|
+
"import/group-exports",
|
|
186
|
+
"import/no-anonymous-default-export",
|
|
187
|
+
"import/no-duplicates",
|
|
188
|
+
"import/no-mutable-exports",
|
|
189
|
+
"import/no-named-default",
|
|
190
|
+
"import/no-named-export",
|
|
191
|
+
"import/no-namespace",
|
|
192
|
+
"import/prefer-default-export",
|
|
303
193
|
"arrow-body-style",
|
|
304
194
|
"capitalized-comments",
|
|
305
195
|
"curly",
|
|
306
196
|
"default-case-last",
|
|
307
197
|
"default-param-last",
|
|
308
|
-
"func-style",
|
|
309
198
|
"func-names",
|
|
199
|
+
"func-style",
|
|
310
200
|
"grouped-accessor-pairs",
|
|
311
201
|
"guard-for-in",
|
|
312
202
|
"id-length",
|
|
@@ -314,48 +204,51 @@ const styleRules = [
|
|
|
314
204
|
"max-params",
|
|
315
205
|
"max-statements",
|
|
316
206
|
"new-cap",
|
|
317
|
-
"no-
|
|
318
|
-
"no-useless-computed-key",
|
|
207
|
+
"no-continue",
|
|
319
208
|
"no-duplicate-imports",
|
|
320
209
|
"no-extra-label",
|
|
210
|
+
"no-implicit-coercion",
|
|
211
|
+
"no-label-var",
|
|
321
212
|
"no-labels",
|
|
322
213
|
"no-lone-blocks",
|
|
323
|
-
"no-multi-assign",
|
|
324
|
-
"no-nested-ternary",
|
|
325
|
-
"no-continue",
|
|
326
|
-
"no-label-var",
|
|
327
214
|
"no-magic-numbers",
|
|
215
|
+
"no-multi-assign",
|
|
328
216
|
"no-multi-str",
|
|
217
|
+
"no-nested-ternary",
|
|
329
218
|
"no-new-func",
|
|
330
219
|
"no-return-assign",
|
|
331
220
|
"no-script-url",
|
|
332
221
|
"no-template-curly-in-string",
|
|
333
222
|
"no-ternary",
|
|
223
|
+
"no-useless-computed-key",
|
|
334
224
|
"operator-assignment",
|
|
335
|
-
"prefer-template",
|
|
336
225
|
"prefer-destructuring",
|
|
337
|
-
"prefer-promise-reject-errors",
|
|
338
226
|
"prefer-exponentiation-operator",
|
|
339
227
|
"prefer-numeric-literals",
|
|
340
228
|
"prefer-object-has-own",
|
|
341
229
|
"prefer-object-spread",
|
|
230
|
+
"prefer-promise-reject-errors",
|
|
342
231
|
"prefer-rest-params",
|
|
343
232
|
"prefer-spread",
|
|
233
|
+
"prefer-template",
|
|
344
234
|
"sort-imports",
|
|
345
235
|
"sort-keys",
|
|
346
236
|
"vars-on-top",
|
|
347
237
|
"yoda",
|
|
348
|
-
"
|
|
349
|
-
"
|
|
350
|
-
"
|
|
351
|
-
"
|
|
352
|
-
"
|
|
353
|
-
"
|
|
354
|
-
"
|
|
355
|
-
"
|
|
356
|
-
"
|
|
357
|
-
"
|
|
358
|
-
"
|
|
238
|
+
"@typescript-eslint/adjacent-overload-signatures",
|
|
239
|
+
"@typescript-eslint/array-type",
|
|
240
|
+
"@typescript-eslint/ban-tslint-comment",
|
|
241
|
+
"@typescript-eslint/consistent-generic-constructors",
|
|
242
|
+
"@typescript-eslint/consistent-indexed-object-style",
|
|
243
|
+
"@typescript-eslint/consistent-type-definitions",
|
|
244
|
+
"@typescript-eslint/consistent-type-imports",
|
|
245
|
+
"@typescript-eslint/no-empty-interface",
|
|
246
|
+
"@typescript-eslint/no-inferrable-types",
|
|
247
|
+
"@typescript-eslint/prefer-for-of",
|
|
248
|
+
"@typescript-eslint/prefer-function-type",
|
|
249
|
+
"@typescript-eslint/prefer-namespace-keyword",
|
|
250
|
+
"@typescript-eslint/prefer-reduce-type-parameter",
|
|
251
|
+
"@typescript-eslint/prefer-return-this-type",
|
|
359
252
|
"jest/consistent-test-it",
|
|
360
253
|
"jest/max-expects",
|
|
361
254
|
"jest/max-nested-describe",
|
|
@@ -376,9 +269,9 @@ const styleRules = [
|
|
|
376
269
|
"jest/no-test-return-statement",
|
|
377
270
|
"jest/no-untyped-mock-factory",
|
|
378
271
|
"jest/padding-around-test-blocks",
|
|
379
|
-
"jest/prefer-each",
|
|
380
272
|
"jest/prefer-called-with",
|
|
381
273
|
"jest/prefer-comparison-matcher",
|
|
274
|
+
"jest/prefer-each",
|
|
382
275
|
"jest/prefer-equality-matcher",
|
|
383
276
|
"jest/prefer-expect-resolves",
|
|
384
277
|
"jest/prefer-hooks-in-order",
|
|
@@ -396,82 +289,66 @@ const styleRules = [
|
|
|
396
289
|
"jest/prefer-todo",
|
|
397
290
|
"jest/require-hook",
|
|
398
291
|
"jest/require-top-level-describe",
|
|
399
|
-
"node/global-require",
|
|
400
|
-
"node/no-exports-assign",
|
|
401
|
-
"promise/avoid-new",
|
|
402
|
-
"promise/no-return-wrap",
|
|
403
|
-
"promise/no-nesting",
|
|
404
|
-
"promise/param-names",
|
|
405
|
-
"promise/prefer-catch",
|
|
406
|
-
"promise/prefer-await-to-callbacks",
|
|
407
|
-
"promise/prefer-await-to-then",
|
|
408
|
-
"react/jsx-pascal-case",
|
|
409
|
-
"react/jsx-fragments",
|
|
410
292
|
"react/jsx-boolean-value",
|
|
411
293
|
"react/jsx-curly-brace-presence",
|
|
294
|
+
"react/jsx-fragments",
|
|
412
295
|
"react/jsx-handler-names",
|
|
413
296
|
"react/jsx-max-depth",
|
|
297
|
+
"react/jsx-pascal-case",
|
|
414
298
|
"react/jsx-props-no-spreading",
|
|
415
299
|
"react/no-redundant-should-component-update",
|
|
416
300
|
"react/no-set-state",
|
|
417
301
|
"react/prefer-es6-class",
|
|
418
302
|
"react/self-closing-comp",
|
|
419
303
|
"react/state-in-constructor",
|
|
420
|
-
"@typescript-eslint/adjacent-overload-signatures",
|
|
421
|
-
"@typescript-eslint/array-type",
|
|
422
|
-
"@typescript-eslint/ban-tslint-comment",
|
|
423
|
-
"@typescript-eslint/consistent-generic-constructors",
|
|
424
|
-
"@typescript-eslint/consistent-indexed-object-style",
|
|
425
|
-
"@typescript-eslint/consistent-type-definitions",
|
|
426
|
-
"@typescript-eslint/consistent-type-imports",
|
|
427
|
-
"@typescript-eslint/no-inferrable-types",
|
|
428
|
-
"@typescript-eslint/no-empty-interface",
|
|
429
|
-
"@typescript-eslint/prefer-for-of",
|
|
430
|
-
"@typescript-eslint/prefer-function-type",
|
|
431
|
-
"@typescript-eslint/prefer-namespace-keyword",
|
|
432
|
-
"@typescript-eslint/prefer-reduce-type-parameter",
|
|
433
|
-
"@typescript-eslint/prefer-return-this-type",
|
|
434
304
|
"unicorn/catch-error-name",
|
|
435
305
|
"unicorn/consistent-date-clone",
|
|
436
306
|
"unicorn/consistent-existence-index-check",
|
|
437
307
|
"unicorn/empty-brace-spaces",
|
|
438
308
|
"unicorn/error-message",
|
|
439
309
|
"unicorn/filename-case",
|
|
440
|
-
"unicorn/no-useless-collection-argument",
|
|
441
310
|
"unicorn/no-array-method-this-argument",
|
|
442
311
|
"unicorn/no-await-expression-member",
|
|
443
312
|
"unicorn/no-console-spaces",
|
|
444
313
|
"unicorn/no-nested-ternary",
|
|
445
314
|
"unicorn/no-null",
|
|
446
315
|
"unicorn/no-unreadable-array-destructuring",
|
|
316
|
+
"unicorn/no-useless-collection-argument",
|
|
447
317
|
"unicorn/no-zero-fractions",
|
|
448
318
|
"unicorn/number-literal-case",
|
|
449
319
|
"unicorn/numeric-separators-style",
|
|
450
|
-
"unicorn/prefer-
|
|
451
|
-
"unicorn/prefer-class-fields",
|
|
320
|
+
"unicorn/prefer-array-index-of",
|
|
452
321
|
"unicorn/prefer-bigint-literals",
|
|
322
|
+
"unicorn/prefer-class-fields",
|
|
323
|
+
"unicorn/prefer-classlist-toggle",
|
|
453
324
|
"unicorn/prefer-default-parameters",
|
|
454
|
-
"unicorn/prefer-response-static-json",
|
|
455
|
-
"unicorn/prefer-global-this",
|
|
456
|
-
"unicorn/prefer-keyboard-event-key",
|
|
457
|
-
"unicorn/prefer-object-from-entries",
|
|
458
|
-
"unicorn/prefer-array-index-of",
|
|
459
|
-
"unicorn/prefer-spread",
|
|
460
325
|
"unicorn/prefer-dom-node-text-content",
|
|
326
|
+
"unicorn/prefer-global-this",
|
|
461
327
|
"unicorn/prefer-includes",
|
|
328
|
+
"unicorn/prefer-keyboard-event-key",
|
|
462
329
|
"unicorn/prefer-logical-operator-over-ternary",
|
|
463
330
|
"unicorn/prefer-modern-dom-apis",
|
|
464
331
|
"unicorn/prefer-negative-index",
|
|
332
|
+
"unicorn/prefer-object-from-entries",
|
|
465
333
|
"unicorn/prefer-optional-catch-binding",
|
|
466
334
|
"unicorn/prefer-reflect-apply",
|
|
335
|
+
"unicorn/prefer-response-static-json",
|
|
336
|
+
"unicorn/prefer-spread",
|
|
467
337
|
"unicorn/prefer-string-raw",
|
|
468
338
|
"unicorn/prefer-string-trim-start-end",
|
|
469
339
|
"unicorn/prefer-structured-clone",
|
|
470
|
-
"unicorn/require-module-attributes",
|
|
471
340
|
"unicorn/require-array-join-separator",
|
|
341
|
+
"unicorn/require-module-attributes",
|
|
472
342
|
"unicorn/switch-case-braces",
|
|
473
343
|
"unicorn/text-encoding-identifier-case",
|
|
474
344
|
"unicorn/throw-new-error",
|
|
345
|
+
"promise/avoid-new",
|
|
346
|
+
"promise/no-nesting",
|
|
347
|
+
"promise/no-return-wrap",
|
|
348
|
+
"promise/param-names",
|
|
349
|
+
"promise/prefer-await-to-callbacks",
|
|
350
|
+
"promise/prefer-await-to-then",
|
|
351
|
+
"promise/prefer-catch",
|
|
475
352
|
"vitest/consistent-test-filename",
|
|
476
353
|
"vitest/consistent-vitest-vi",
|
|
477
354
|
"vitest/no-import-node-test",
|
|
@@ -482,25 +359,27 @@ const styleRules = [
|
|
|
482
359
|
"vitest/prefer-to-be-falsy",
|
|
483
360
|
"vitest/prefer-to-be-object",
|
|
484
361
|
"vitest/prefer-to-be-truthy",
|
|
362
|
+
"node/global-require",
|
|
363
|
+
"node/no-exports-assign",
|
|
485
364
|
"vue/define-emits-declaration",
|
|
486
365
|
"vue/define-props-declaration",
|
|
487
366
|
"vue/define-props-destructuring",
|
|
488
367
|
"vue/require-typed-ref",
|
|
489
|
-
"@typescript-eslint/default-param-last",
|
|
490
|
-
"@typescript-eslint/init-declarations",
|
|
491
|
-
"@typescript-eslint/max-params",
|
|
492
|
-
"@typescript-eslint/no-magic-numbers",
|
|
493
368
|
"import-x/consistent-type-specifier-style",
|
|
494
369
|
"import-x/exports-last",
|
|
495
370
|
"import-x/first",
|
|
496
371
|
"import-x/group-exports",
|
|
497
|
-
"import-x/no-named-export",
|
|
498
372
|
"import-x/no-anonymous-default-export",
|
|
373
|
+
"import-x/no-duplicates",
|
|
499
374
|
"import-x/no-mutable-exports",
|
|
500
375
|
"import-x/no-named-default",
|
|
376
|
+
"import-x/no-named-export",
|
|
501
377
|
"import-x/no-namespace",
|
|
502
|
-
"import-x/no-duplicates",
|
|
503
378
|
"import-x/prefer-default-export",
|
|
379
|
+
"@typescript-eslint/default-param-last",
|
|
380
|
+
"@typescript-eslint/init-declarations",
|
|
381
|
+
"@typescript-eslint/max-params",
|
|
382
|
+
"@typescript-eslint/no-magic-numbers",
|
|
504
383
|
"vitest/consistent-test-it",
|
|
505
384
|
"vitest/max-expects",
|
|
506
385
|
"vitest/max-nested-describe",
|
|
@@ -515,9 +394,9 @@ const styleRules = [
|
|
|
515
394
|
"vitest/no-restricted-matchers",
|
|
516
395
|
"vitest/no-test-prefixes",
|
|
517
396
|
"vitest/no-test-return-statement",
|
|
518
|
-
"vitest/prefer-each",
|
|
519
397
|
"vitest/prefer-called-with",
|
|
520
398
|
"vitest/prefer-comparison-matcher",
|
|
399
|
+
"vitest/prefer-each",
|
|
521
400
|
"vitest/prefer-equality-matcher",
|
|
522
401
|
"vitest/prefer-expect-resolves",
|
|
523
402
|
"vitest/prefer-hooks-in-order",
|
|
@@ -531,158 +410,18 @@ const styleRules = [
|
|
|
531
410
|
"vitest/prefer-to-have-length",
|
|
532
411
|
"vitest/prefer-todo",
|
|
533
412
|
"vitest/require-hook",
|
|
534
|
-
"vitest/require-top-level-describe"
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
"block-scoped-var",
|
|
538
|
-
"no-extra-bind",
|
|
539
|
-
"no-unneeded-ternary",
|
|
540
|
-
"no-extend-native",
|
|
541
|
-
"no-new",
|
|
542
|
-
"no-unexpected-multiline",
|
|
543
|
-
"no-useless-concat",
|
|
544
|
-
"no-useless-constructor",
|
|
545
|
-
"preserve-caught-error",
|
|
546
|
-
"import/no-unassigned-import",
|
|
547
|
-
"import/no-empty-named-blocks",
|
|
548
|
-
"import/no-absolute-path",
|
|
549
|
-
"import/no-named-as-default",
|
|
550
|
-
"import/no-named-as-default-member",
|
|
551
|
-
"import/no-self-import",
|
|
552
|
-
"jest/no-commented-out-tests",
|
|
553
|
-
"promise/always-return",
|
|
554
|
-
"promise/no-promise-in-callback",
|
|
555
|
-
"promise/no-multiple-resolved",
|
|
556
|
-
"react/iframe-missing-sandbox",
|
|
557
|
-
"react/jsx-no-comment-textnodes",
|
|
558
|
-
"react/jsx-no-script-url",
|
|
559
|
-
"react/no-namespace",
|
|
560
|
-
"react/react-in-jsx-scope",
|
|
561
|
-
"react/style-prop-object",
|
|
562
|
-
"@typescript-eslint/no-confusing-non-null-assertion",
|
|
563
|
-
"@typescript-eslint/no-extraneous-class",
|
|
564
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare",
|
|
565
|
-
"@typescript-eslint/no-unnecessary-template-expression",
|
|
566
|
-
"@typescript-eslint/no-unnecessary-type-arguments",
|
|
567
|
-
"@typescript-eslint/no-unnecessary-type-assertion",
|
|
568
|
-
"@typescript-eslint/no-unnecessary-type-constraint",
|
|
569
|
-
"@typescript-eslint/no-unsafe-enum-comparison",
|
|
570
|
-
"@typescript-eslint/no-unsafe-type-assertion",
|
|
571
|
-
"unicorn/consistent-function-scoping",
|
|
572
|
-
"unicorn/no-array-sort",
|
|
573
|
-
"unicorn/no-array-reverse",
|
|
574
|
-
"unicorn/no-instanceof-builtins",
|
|
575
|
-
"unicorn/no-accessor-recursion",
|
|
576
|
-
"unicorn/prefer-add-event-listener",
|
|
577
|
-
"unicorn/require-module-specifiers",
|
|
578
|
-
"unicorn/require-post-message-target-origin",
|
|
579
|
-
"vue/no-required-prop-with-default",
|
|
580
|
-
"vue/require-default-export",
|
|
581
|
-
"@typescript-eslint/no-useless-constructor",
|
|
582
|
-
"import-x/no-unassigned-import",
|
|
583
|
-
"import-x/no-empty-named-blocks",
|
|
584
|
-
"import-x/no-absolute-path",
|
|
585
|
-
"import-x/no-named-as-default",
|
|
586
|
-
"import-x/no-named-as-default-member",
|
|
587
|
-
"import-x/no-self-import",
|
|
588
|
-
"vitest/no-commented-out-tests"
|
|
589
|
-
];
|
|
590
|
-
const restrictionRules = [
|
|
591
|
-
"class-methods-use-this",
|
|
592
|
-
"complexity",
|
|
593
|
-
"default-case",
|
|
594
|
-
"no-alert",
|
|
595
|
-
"no-bitwise",
|
|
596
|
-
"no-param-reassign",
|
|
597
|
-
"no-restricted-imports",
|
|
598
|
-
"no-console",
|
|
599
|
-
"no-div-regex",
|
|
600
|
-
"no-empty-function",
|
|
601
|
-
"no-empty",
|
|
602
|
-
"no-eq-null",
|
|
603
|
-
"no-iterator",
|
|
604
|
-
"no-plusplus",
|
|
605
|
-
"no-proto",
|
|
606
|
-
"no-regex-spaces",
|
|
607
|
-
"no-restricted-globals",
|
|
608
|
-
"no-sequences",
|
|
609
|
-
"no-undefined",
|
|
610
|
-
"no-var",
|
|
611
|
-
"no-void",
|
|
612
|
-
"unicode-bom",
|
|
613
|
-
"import/extensions",
|
|
614
|
-
"import/no-amd",
|
|
615
|
-
"import/no-commonjs",
|
|
616
|
-
"import/no-cycle",
|
|
617
|
-
"import/no-default-export",
|
|
618
|
-
"import/no-dynamic-require",
|
|
619
|
-
"import/no-webpack-loader-syntax",
|
|
620
|
-
"import/unambiguous",
|
|
621
|
-
"jsdoc/check-access",
|
|
622
|
-
"jsdoc/empty-tags",
|
|
623
|
-
"jsx-a11y/anchor-ambiguous-text",
|
|
624
|
-
"node/no-process-env",
|
|
625
|
-
"node/no-new-require",
|
|
626
|
-
"promise/catch-or-return",
|
|
627
|
-
"promise/spec-only",
|
|
628
|
-
"react/button-has-type",
|
|
629
|
-
"react/forbid-dom-props",
|
|
630
|
-
"react/forbid-elements",
|
|
631
|
-
"react/jsx-filename-extension",
|
|
632
|
-
"react/no-danger",
|
|
633
|
-
"react/no-unknown-property",
|
|
634
|
-
"react/only-export-components",
|
|
635
|
-
"@typescript-eslint/explicit-module-boundary-types",
|
|
636
|
-
"@typescript-eslint/explicit-function-return-type",
|
|
637
|
-
"@typescript-eslint/no-dynamic-delete",
|
|
638
|
-
"@typescript-eslint/no-empty-object-type",
|
|
639
|
-
"@typescript-eslint/no-explicit-any",
|
|
640
|
-
"@typescript-eslint/no-import-type-side-effects",
|
|
641
|
-
"@typescript-eslint/no-namespace",
|
|
642
|
-
"@typescript-eslint/no-non-null-asserted-nullish-coalescing",
|
|
643
|
-
"@typescript-eslint/no-non-null-assertion",
|
|
644
|
-
"@typescript-eslint/no-require-imports",
|
|
645
|
-
"@typescript-eslint/no-restricted-types",
|
|
646
|
-
"@typescript-eslint/no-var-requires",
|
|
647
|
-
"@typescript-eslint/non-nullable-type-assertion-style",
|
|
648
|
-
"@typescript-eslint/prefer-literal-enum-member",
|
|
649
|
-
"@typescript-eslint/promise-function-async",
|
|
650
|
-
"@typescript-eslint/use-unknown-in-catch-callback-variable",
|
|
651
|
-
"unicorn/no-useless-error-capture-stack-trace",
|
|
652
|
-
"unicorn/no-abusive-eslint-disable",
|
|
653
|
-
"unicorn/no-anonymous-default-export",
|
|
654
|
-
"unicorn/no-array-for-each",
|
|
655
|
-
"unicorn/no-array-reduce",
|
|
656
|
-
"unicorn/no-document-cookie",
|
|
657
|
-
"unicorn/no-length-as-slice-end",
|
|
658
|
-
"unicorn/no-magic-array-flat-depth",
|
|
659
|
-
"unicorn/no-process-exit",
|
|
660
|
-
"unicorn/prefer-modern-math-apis",
|
|
661
|
-
"unicorn/prefer-node-protocol",
|
|
662
|
-
"unicorn/prefer-number-properties",
|
|
663
|
-
"vue/max-props",
|
|
664
|
-
"vue/no-import-compiler-macros",
|
|
665
|
-
"vue/no-multiple-slot-args",
|
|
666
|
-
"@typescript-eslint/class-methods-use-this",
|
|
667
|
-
"@typescript-eslint/no-restricted-imports",
|
|
668
|
-
"@typescript-eslint/no-empty-function",
|
|
669
|
-
"import-x/extensions",
|
|
670
|
-
"import-x/no-amd",
|
|
671
|
-
"import-x/no-commonjs",
|
|
672
|
-
"import-x/no-cycle",
|
|
673
|
-
"import-x/no-default-export",
|
|
674
|
-
"import-x/no-dynamic-require",
|
|
675
|
-
"import-x/no-webpack-loader-syntax",
|
|
676
|
-
"import-x/unambiguous"
|
|
413
|
+
"vitest/require-top-level-describe",
|
|
414
|
+
"n/global-require",
|
|
415
|
+
"n/no-exports-assign"
|
|
677
416
|
];
|
|
678
417
|
const correctnessRules = [
|
|
418
|
+
"import/default",
|
|
419
|
+
"import/namespace",
|
|
679
420
|
"constructor-super",
|
|
680
421
|
"for-direction",
|
|
681
|
-
"no-unassigned-vars",
|
|
682
422
|
"no-async-promise-executor",
|
|
683
423
|
"no-caller",
|
|
684
424
|
"no-class-assign",
|
|
685
|
-
"no-useless-backreference",
|
|
686
425
|
"no-compare-neg-zero",
|
|
687
426
|
"no-cond-assign",
|
|
688
427
|
"no-const-assign",
|
|
@@ -715,6 +454,7 @@ const correctnessRules = [
|
|
|
715
454
|
"no-shadow-restricted-names",
|
|
716
455
|
"no-sparse-arrays",
|
|
717
456
|
"no-this-before-super",
|
|
457
|
+
"no-unassigned-vars",
|
|
718
458
|
"no-unsafe-finally",
|
|
719
459
|
"no-unsafe-negation",
|
|
720
460
|
"no-unsafe-optional-chaining",
|
|
@@ -722,6 +462,7 @@ const correctnessRules = [
|
|
|
722
462
|
"no-unused-labels",
|
|
723
463
|
"no-unused-private-class-members",
|
|
724
464
|
"no-unused-vars",
|
|
465
|
+
"no-useless-backreference",
|
|
725
466
|
"no-useless-catch",
|
|
726
467
|
"no-useless-escape",
|
|
727
468
|
"no-useless-rename",
|
|
@@ -729,8 +470,31 @@ const correctnessRules = [
|
|
|
729
470
|
"require-yield",
|
|
730
471
|
"use-isnan",
|
|
731
472
|
"valid-typeof",
|
|
732
|
-
"
|
|
733
|
-
"
|
|
473
|
+
"@typescript-eslint/await-thenable",
|
|
474
|
+
"@typescript-eslint/no-array-delete",
|
|
475
|
+
"@typescript-eslint/no-base-to-string",
|
|
476
|
+
"@typescript-eslint/no-duplicate-enum-values",
|
|
477
|
+
"@typescript-eslint/no-duplicate-type-constituents",
|
|
478
|
+
"@typescript-eslint/no-extra-non-null-assertion",
|
|
479
|
+
"@typescript-eslint/no-floating-promises",
|
|
480
|
+
"@typescript-eslint/no-for-in-array",
|
|
481
|
+
"@typescript-eslint/no-implied-eval",
|
|
482
|
+
"@typescript-eslint/no-meaningless-void-operator",
|
|
483
|
+
"@typescript-eslint/no-misused-new",
|
|
484
|
+
"@typescript-eslint/no-misused-spread",
|
|
485
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain",
|
|
486
|
+
"@typescript-eslint/no-redundant-type-constituents",
|
|
487
|
+
"@typescript-eslint/no-this-alias",
|
|
488
|
+
"@typescript-eslint/no-unnecessary-parameter-property-assignment",
|
|
489
|
+
"@typescript-eslint/no-unsafe-declaration-merging",
|
|
490
|
+
"@typescript-eslint/no-unsafe-unary-minus",
|
|
491
|
+
"@typescript-eslint/no-useless-empty-export",
|
|
492
|
+
"@typescript-eslint/no-wrapper-object-types",
|
|
493
|
+
"@typescript-eslint/prefer-as-const",
|
|
494
|
+
"@typescript-eslint/require-array-sort-compare",
|
|
495
|
+
"@typescript-eslint/restrict-template-expressions",
|
|
496
|
+
"@typescript-eslint/triple-slash-reference",
|
|
497
|
+
"@typescript-eslint/unbound-method",
|
|
734
498
|
"jest/expect-expect",
|
|
735
499
|
"jest/no-conditional-expect",
|
|
736
500
|
"jest/no-disabled-tests",
|
|
@@ -741,15 +505,37 @@ const correctnessRules = [
|
|
|
741
505
|
"jest/valid-describe-callback",
|
|
742
506
|
"jest/valid-expect",
|
|
743
507
|
"jest/valid-title",
|
|
744
|
-
"
|
|
745
|
-
"
|
|
746
|
-
"
|
|
747
|
-
"
|
|
748
|
-
"
|
|
749
|
-
"
|
|
750
|
-
"
|
|
751
|
-
"
|
|
752
|
-
"
|
|
508
|
+
"react-hooks/exhaustive-deps",
|
|
509
|
+
"react/forward-ref-uses-ref",
|
|
510
|
+
"react/jsx-key",
|
|
511
|
+
"react/jsx-no-duplicate-props",
|
|
512
|
+
"react/jsx-no-undef",
|
|
513
|
+
"react/jsx-props-no-spread-multi",
|
|
514
|
+
"react/no-children-prop",
|
|
515
|
+
"react/no-danger-with-children",
|
|
516
|
+
"react/no-did-mount-set-state",
|
|
517
|
+
"react/no-direct-mutation-state",
|
|
518
|
+
"react/no-find-dom-node",
|
|
519
|
+
"react/no-is-mounted",
|
|
520
|
+
"react/no-render-return-value",
|
|
521
|
+
"react/no-string-refs",
|
|
522
|
+
"react/no-this-in-sfc",
|
|
523
|
+
"react/no-unsafe",
|
|
524
|
+
"react/no-will-update-set-state",
|
|
525
|
+
"react/void-dom-elements-no-children",
|
|
526
|
+
"unicorn/no-await-in-promise-methods",
|
|
527
|
+
"unicorn/no-empty-file",
|
|
528
|
+
"unicorn/no-invalid-fetch-options",
|
|
529
|
+
"unicorn/no-invalid-remove-event-listener",
|
|
530
|
+
"unicorn/no-new-array",
|
|
531
|
+
"unicorn/no-single-promise-in-promise-methods",
|
|
532
|
+
"unicorn/no-thenable",
|
|
533
|
+
"unicorn/no-unnecessary-await",
|
|
534
|
+
"unicorn/no-useless-fallback-in-spread",
|
|
535
|
+
"unicorn/no-useless-length-check",
|
|
536
|
+
"unicorn/no-useless-spread",
|
|
537
|
+
"unicorn/prefer-set-size",
|
|
538
|
+
"unicorn/prefer-string-starts-ends-with",
|
|
753
539
|
"jsx-a11y/alt-text",
|
|
754
540
|
"jsx-a11y/anchor-has-content",
|
|
755
541
|
"jsx-a11y/anchor-is-valid",
|
|
@@ -768,11 +554,11 @@ const correctnessRules = [
|
|
|
768
554
|
"jsx-a11y/lang",
|
|
769
555
|
"jsx-a11y/media-has-caption",
|
|
770
556
|
"jsx-a11y/mouse-events-have-key-events",
|
|
771
|
-
"jsx-a11y/no-noninteractive-tabindex",
|
|
772
557
|
"jsx-a11y/no-access-key",
|
|
773
558
|
"jsx-a11y/no-aria-hidden-on-focusable",
|
|
774
559
|
"jsx-a11y/no-autofocus",
|
|
775
560
|
"jsx-a11y/no-distracting-elements",
|
|
561
|
+
"jsx-a11y/no-noninteractive-tabindex",
|
|
776
562
|
"jsx-a11y/no-redundant-roles",
|
|
777
563
|
"jsx-a11y/prefer-tag-over-role",
|
|
778
564
|
"jsx-a11y/role-has-required-aria-props",
|
|
@@ -791,6 +577,7 @@ const correctnessRules = [
|
|
|
791
577
|
"@next/next/no-duplicate-head",
|
|
792
578
|
"@next/next/no-head-element",
|
|
793
579
|
"@next/next/no-head-import-in-document",
|
|
580
|
+
"@next/next/no-html-link-for-pages",
|
|
794
581
|
"@next/next/no-img-element",
|
|
795
582
|
"@next/next/no-page-custom-font",
|
|
796
583
|
"@next/next/no-script-component-in-head",
|
|
@@ -799,66 +586,18 @@ const correctnessRules = [
|
|
|
799
586
|
"@next/next/no-title-in-document-head",
|
|
800
587
|
"@next/next/no-typos",
|
|
801
588
|
"@next/next/no-unwanted-polyfillio",
|
|
802
|
-
"
|
|
589
|
+
"jsdoc/check-property-names",
|
|
590
|
+
"jsdoc/check-tag-names",
|
|
591
|
+
"jsdoc/implements-on-classes",
|
|
592
|
+
"jsdoc/no-defaults",
|
|
593
|
+
"jsdoc/require-property",
|
|
594
|
+
"jsdoc/require-property-description",
|
|
595
|
+
"jsdoc/require-property-name",
|
|
596
|
+
"jsdoc/require-property-type",
|
|
597
|
+
"jsdoc/require-yields",
|
|
803
598
|
"promise/no-callback-in-promise",
|
|
804
599
|
"promise/no-new-statics",
|
|
805
600
|
"promise/valid-params",
|
|
806
|
-
"react-hooks/exhaustive-deps",
|
|
807
|
-
"react/forward-ref-uses-ref",
|
|
808
|
-
"react/jsx-key",
|
|
809
|
-
"react/jsx-no-duplicate-props",
|
|
810
|
-
"react/jsx-no-undef",
|
|
811
|
-
"react/jsx-props-no-spread-multi",
|
|
812
|
-
"react/no-did-mount-set-state",
|
|
813
|
-
"react/no-children-prop",
|
|
814
|
-
"react/no-danger-with-children",
|
|
815
|
-
"react/no-direct-mutation-state",
|
|
816
|
-
"react/no-find-dom-node",
|
|
817
|
-
"react/no-is-mounted",
|
|
818
|
-
"react/no-render-return-value",
|
|
819
|
-
"react/no-string-refs",
|
|
820
|
-
"react/no-this-in-sfc",
|
|
821
|
-
"react/no-unsafe",
|
|
822
|
-
"react/no-will-update-set-state",
|
|
823
|
-
"react/void-dom-elements-no-children",
|
|
824
|
-
"@typescript-eslint/await-thenable",
|
|
825
|
-
"@typescript-eslint/no-floating-promises",
|
|
826
|
-
"@typescript-eslint/no-array-delete",
|
|
827
|
-
"@typescript-eslint/no-base-to-string",
|
|
828
|
-
"@typescript-eslint/no-duplicate-enum-values",
|
|
829
|
-
"@typescript-eslint/no-duplicate-type-constituents",
|
|
830
|
-
"@typescript-eslint/no-extra-non-null-assertion",
|
|
831
|
-
"@typescript-eslint/no-for-in-array",
|
|
832
|
-
"@typescript-eslint/no-implied-eval",
|
|
833
|
-
"@typescript-eslint/no-meaningless-void-operator",
|
|
834
|
-
"@typescript-eslint/no-misused-new",
|
|
835
|
-
"@typescript-eslint/no-misused-spread",
|
|
836
|
-
"@typescript-eslint/no-non-null-asserted-optional-chain",
|
|
837
|
-
"@typescript-eslint/no-redundant-type-constituents",
|
|
838
|
-
"@typescript-eslint/no-this-alias",
|
|
839
|
-
"@typescript-eslint/no-unnecessary-parameter-property-assignment",
|
|
840
|
-
"@typescript-eslint/no-unsafe-declaration-merging",
|
|
841
|
-
"@typescript-eslint/no-unsafe-unary-minus",
|
|
842
|
-
"@typescript-eslint/no-useless-empty-export",
|
|
843
|
-
"@typescript-eslint/no-wrapper-object-types",
|
|
844
|
-
"@typescript-eslint/prefer-as-const",
|
|
845
|
-
"@typescript-eslint/require-array-sort-compare",
|
|
846
|
-
"@typescript-eslint/restrict-template-expressions",
|
|
847
|
-
"@typescript-eslint/triple-slash-reference",
|
|
848
|
-
"@typescript-eslint/unbound-method",
|
|
849
|
-
"unicorn/no-invalid-fetch-options",
|
|
850
|
-
"unicorn/no-await-in-promise-methods",
|
|
851
|
-
"unicorn/no-empty-file",
|
|
852
|
-
"unicorn/no-invalid-remove-event-listener",
|
|
853
|
-
"unicorn/no-new-array",
|
|
854
|
-
"unicorn/no-single-promise-in-promise-methods",
|
|
855
|
-
"unicorn/no-thenable",
|
|
856
|
-
"unicorn/no-unnecessary-await",
|
|
857
|
-
"unicorn/no-useless-fallback-in-spread",
|
|
858
|
-
"unicorn/no-useless-length-check",
|
|
859
|
-
"unicorn/no-useless-spread",
|
|
860
|
-
"unicorn/prefer-set-size",
|
|
861
|
-
"unicorn/prefer-string-starts-ends-with",
|
|
862
601
|
"vitest/consistent-each-for",
|
|
863
602
|
"vitest/hoisted-apis-on-top",
|
|
864
603
|
"vitest/no-conditional-tests",
|
|
@@ -872,12 +611,12 @@ const correctnessRules = [
|
|
|
872
611
|
"vue/prefer-import-from-vue",
|
|
873
612
|
"vue/valid-define-emits",
|
|
874
613
|
"vue/valid-define-props",
|
|
614
|
+
"import-x/default",
|
|
615
|
+
"import-x/namespace",
|
|
875
616
|
"@typescript-eslint/no-dupe-class-members",
|
|
876
617
|
"@typescript-eslint/no-loss-of-precision",
|
|
877
618
|
"@typescript-eslint/no-unused-expressions",
|
|
878
619
|
"@typescript-eslint/no-unused-vars",
|
|
879
|
-
"import-x/default",
|
|
880
|
-
"import-x/namespace",
|
|
881
620
|
"vitest/expect-expect",
|
|
882
621
|
"vitest/no-conditional-expect",
|
|
883
622
|
"vitest/no-disabled-tests",
|
|
@@ -887,19 +626,286 @@ const correctnessRules = [
|
|
|
887
626
|
"vitest/valid-describe-callback",
|
|
888
627
|
"vitest/valid-expect"
|
|
889
628
|
];
|
|
890
|
-
const nurseryRules = [
|
|
891
|
-
"
|
|
892
|
-
"
|
|
893
|
-
"
|
|
894
|
-
"no-
|
|
895
|
-
"
|
|
896
|
-
"
|
|
897
|
-
"
|
|
898
|
-
"
|
|
899
|
-
"
|
|
900
|
-
"
|
|
901
|
-
"import-x/export",
|
|
902
|
-
"import-x/named"
|
|
629
|
+
const nurseryRules = [
|
|
630
|
+
"import/export",
|
|
631
|
+
"import/named",
|
|
632
|
+
"getter-return",
|
|
633
|
+
"no-misleading-character-class",
|
|
634
|
+
"no-undef",
|
|
635
|
+
"no-unreachable",
|
|
636
|
+
"@typescript-eslint/prefer-optional-chain",
|
|
637
|
+
"react/require-render-return",
|
|
638
|
+
"jsx-a11y/no-static-element-interactions",
|
|
639
|
+
"promise/no-return-in-finally",
|
|
640
|
+
"import-x/export",
|
|
641
|
+
"import-x/named"
|
|
642
|
+
];
|
|
643
|
+
const restrictionRules = [
|
|
644
|
+
"import/extensions",
|
|
645
|
+
"import/no-amd",
|
|
646
|
+
"import/no-commonjs",
|
|
647
|
+
"import/no-cycle",
|
|
648
|
+
"import/no-default-export",
|
|
649
|
+
"import/no-dynamic-require",
|
|
650
|
+
"import/no-webpack-loader-syntax",
|
|
651
|
+
"import/unambiguous",
|
|
652
|
+
"class-methods-use-this",
|
|
653
|
+
"complexity",
|
|
654
|
+
"default-case",
|
|
655
|
+
"no-alert",
|
|
656
|
+
"no-bitwise",
|
|
657
|
+
"no-console",
|
|
658
|
+
"no-div-regex",
|
|
659
|
+
"no-empty",
|
|
660
|
+
"no-empty-function",
|
|
661
|
+
"no-eq-null",
|
|
662
|
+
"no-iterator",
|
|
663
|
+
"no-param-reassign",
|
|
664
|
+
"no-plusplus",
|
|
665
|
+
"no-proto",
|
|
666
|
+
"no-regex-spaces",
|
|
667
|
+
"no-restricted-globals",
|
|
668
|
+
"no-restricted-imports",
|
|
669
|
+
"no-sequences",
|
|
670
|
+
"no-undefined",
|
|
671
|
+
"no-var",
|
|
672
|
+
"no-void",
|
|
673
|
+
"unicode-bom",
|
|
674
|
+
"@typescript-eslint/explicit-function-return-type",
|
|
675
|
+
"@typescript-eslint/explicit-module-boundary-types",
|
|
676
|
+
"@typescript-eslint/no-dynamic-delete",
|
|
677
|
+
"@typescript-eslint/no-empty-object-type",
|
|
678
|
+
"@typescript-eslint/no-explicit-any",
|
|
679
|
+
"@typescript-eslint/no-import-type-side-effects",
|
|
680
|
+
"@typescript-eslint/no-namespace",
|
|
681
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing",
|
|
682
|
+
"@typescript-eslint/no-non-null-assertion",
|
|
683
|
+
"@typescript-eslint/no-require-imports",
|
|
684
|
+
"@typescript-eslint/no-restricted-types",
|
|
685
|
+
"@typescript-eslint/no-var-requires",
|
|
686
|
+
"@typescript-eslint/non-nullable-type-assertion-style",
|
|
687
|
+
"@typescript-eslint/prefer-literal-enum-member",
|
|
688
|
+
"@typescript-eslint/promise-function-async",
|
|
689
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable",
|
|
690
|
+
"react/button-has-type",
|
|
691
|
+
"react/forbid-dom-props",
|
|
692
|
+
"react/forbid-elements",
|
|
693
|
+
"react/jsx-filename-extension",
|
|
694
|
+
"react/no-danger",
|
|
695
|
+
"react/no-unknown-property",
|
|
696
|
+
"react/only-export-components",
|
|
697
|
+
"unicorn/no-abusive-eslint-disable",
|
|
698
|
+
"unicorn/no-anonymous-default-export",
|
|
699
|
+
"unicorn/no-array-for-each",
|
|
700
|
+
"unicorn/no-array-reduce",
|
|
701
|
+
"unicorn/no-document-cookie",
|
|
702
|
+
"unicorn/no-length-as-slice-end",
|
|
703
|
+
"unicorn/no-magic-array-flat-depth",
|
|
704
|
+
"unicorn/no-process-exit",
|
|
705
|
+
"unicorn/no-useless-error-capture-stack-trace",
|
|
706
|
+
"unicorn/prefer-modern-math-apis",
|
|
707
|
+
"unicorn/prefer-node-protocol",
|
|
708
|
+
"unicorn/prefer-number-properties",
|
|
709
|
+
"jsx-a11y/anchor-ambiguous-text",
|
|
710
|
+
"jsdoc/check-access",
|
|
711
|
+
"jsdoc/empty-tags",
|
|
712
|
+
"promise/catch-or-return",
|
|
713
|
+
"promise/spec-only",
|
|
714
|
+
"node/no-new-require",
|
|
715
|
+
"node/no-process-env",
|
|
716
|
+
"vue/max-props",
|
|
717
|
+
"vue/no-import-compiler-macros",
|
|
718
|
+
"vue/no-multiple-slot-args",
|
|
719
|
+
"import-x/extensions",
|
|
720
|
+
"import-x/no-amd",
|
|
721
|
+
"import-x/no-commonjs",
|
|
722
|
+
"import-x/no-cycle",
|
|
723
|
+
"import-x/no-default-export",
|
|
724
|
+
"import-x/no-dynamic-require",
|
|
725
|
+
"import-x/no-webpack-loader-syntax",
|
|
726
|
+
"import-x/unambiguous",
|
|
727
|
+
"@typescript-eslint/class-methods-use-this",
|
|
728
|
+
"@typescript-eslint/no-empty-function",
|
|
729
|
+
"@typescript-eslint/no-restricted-imports",
|
|
730
|
+
"react-refresh/only-export-components",
|
|
731
|
+
"n/no-new-require",
|
|
732
|
+
"n/no-process-env"
|
|
733
|
+
];
|
|
734
|
+
const pedanticRules = [
|
|
735
|
+
"import/max-dependencies",
|
|
736
|
+
"accessor-pairs",
|
|
737
|
+
"array-callback-return",
|
|
738
|
+
"eqeqeq",
|
|
739
|
+
"max-classes-per-file",
|
|
740
|
+
"max-depth",
|
|
741
|
+
"max-lines",
|
|
742
|
+
"max-lines-per-function",
|
|
743
|
+
"max-nested-callbacks",
|
|
744
|
+
"no-array-constructor",
|
|
745
|
+
"no-case-declarations",
|
|
746
|
+
"no-constructor-return",
|
|
747
|
+
"no-else-return",
|
|
748
|
+
"no-fallthrough",
|
|
749
|
+
"no-inline-comments",
|
|
750
|
+
"no-inner-declarations",
|
|
751
|
+
"no-lonely-if",
|
|
752
|
+
"no-loop-func",
|
|
753
|
+
"no-negated-condition",
|
|
754
|
+
"no-new-wrappers",
|
|
755
|
+
"no-object-constructor",
|
|
756
|
+
"no-promise-executor-return",
|
|
757
|
+
"no-prototype-builtins",
|
|
758
|
+
"no-redeclare",
|
|
759
|
+
"no-self-compare",
|
|
760
|
+
"no-throw-literal",
|
|
761
|
+
"no-useless-return",
|
|
762
|
+
"no-warning-comments",
|
|
763
|
+
"radix",
|
|
764
|
+
"require-await",
|
|
765
|
+
"sort-vars",
|
|
766
|
+
"symbol-description",
|
|
767
|
+
"@typescript-eslint/ban-ts-comment",
|
|
768
|
+
"@typescript-eslint/ban-types",
|
|
769
|
+
"@typescript-eslint/no-confusing-void-expression",
|
|
770
|
+
"@typescript-eslint/no-deprecated",
|
|
771
|
+
"@typescript-eslint/no-misused-promises",
|
|
772
|
+
"@typescript-eslint/no-mixed-enums",
|
|
773
|
+
"@typescript-eslint/no-unsafe-argument",
|
|
774
|
+
"@typescript-eslint/no-unsafe-assignment",
|
|
775
|
+
"@typescript-eslint/no-unsafe-call",
|
|
776
|
+
"@typescript-eslint/no-unsafe-function-type",
|
|
777
|
+
"@typescript-eslint/no-unsafe-member-access",
|
|
778
|
+
"@typescript-eslint/no-unsafe-return",
|
|
779
|
+
"@typescript-eslint/only-throw-error",
|
|
780
|
+
"@typescript-eslint/prefer-enum-initializers",
|
|
781
|
+
"@typescript-eslint/prefer-includes",
|
|
782
|
+
"@typescript-eslint/prefer-nullish-coalescing",
|
|
783
|
+
"@typescript-eslint/prefer-promise-reject-errors",
|
|
784
|
+
"@typescript-eslint/prefer-ts-expect-error",
|
|
785
|
+
"@typescript-eslint/related-getter-setter-pairs",
|
|
786
|
+
"@typescript-eslint/require-await",
|
|
787
|
+
"@typescript-eslint/restrict-plus-operands",
|
|
788
|
+
"@typescript-eslint/return-await",
|
|
789
|
+
"@typescript-eslint/strict-boolean-expressions",
|
|
790
|
+
"@typescript-eslint/switch-exhaustiveness-check",
|
|
791
|
+
"jest/no-conditional-in-test",
|
|
792
|
+
"react/checked-requires-onchange-or-readonly",
|
|
793
|
+
"react/display-name",
|
|
794
|
+
"react/jsx-no-target-blank",
|
|
795
|
+
"react/jsx-no-useless-fragment",
|
|
796
|
+
"react/no-unescaped-entities",
|
|
797
|
+
"react-hooks/rules-of-hooks",
|
|
798
|
+
"unicorn/consistent-assert",
|
|
799
|
+
"unicorn/consistent-empty-array-spread",
|
|
800
|
+
"unicorn/escape-case",
|
|
801
|
+
"unicorn/explicit-length-check",
|
|
802
|
+
"unicorn/new-for-builtins",
|
|
803
|
+
"unicorn/no-array-callback-reference",
|
|
804
|
+
"unicorn/no-hex-escape",
|
|
805
|
+
"unicorn/no-immediate-mutation",
|
|
806
|
+
"unicorn/no-instanceof-array",
|
|
807
|
+
"unicorn/no-lonely-if",
|
|
808
|
+
"unicorn/no-negation-in-equality-check",
|
|
809
|
+
"unicorn/no-new-buffer",
|
|
810
|
+
"unicorn/no-object-as-default-parameter",
|
|
811
|
+
"unicorn/no-static-only-class",
|
|
812
|
+
"unicorn/no-this-assignment",
|
|
813
|
+
"unicorn/no-typeof-undefined",
|
|
814
|
+
"unicorn/no-unnecessary-array-flat-depth",
|
|
815
|
+
"unicorn/no-unnecessary-array-splice-count",
|
|
816
|
+
"unicorn/no-unnecessary-slice-end",
|
|
817
|
+
"unicorn/no-unreadable-iife",
|
|
818
|
+
"unicorn/no-useless-promise-resolve-reject",
|
|
819
|
+
"unicorn/no-useless-switch-case",
|
|
820
|
+
"unicorn/no-useless-undefined",
|
|
821
|
+
"unicorn/prefer-array-flat",
|
|
822
|
+
"unicorn/prefer-array-some",
|
|
823
|
+
"unicorn/prefer-at",
|
|
824
|
+
"unicorn/prefer-blob-reading-methods",
|
|
825
|
+
"unicorn/prefer-code-point",
|
|
826
|
+
"unicorn/prefer-date-now",
|
|
827
|
+
"unicorn/prefer-dom-node-append",
|
|
828
|
+
"unicorn/prefer-dom-node-dataset",
|
|
829
|
+
"unicorn/prefer-dom-node-remove",
|
|
830
|
+
"unicorn/prefer-event-target",
|
|
831
|
+
"unicorn/prefer-math-min-max",
|
|
832
|
+
"unicorn/prefer-math-trunc",
|
|
833
|
+
"unicorn/prefer-native-coercion-functions",
|
|
834
|
+
"unicorn/prefer-prototype-methods",
|
|
835
|
+
"unicorn/prefer-query-selector",
|
|
836
|
+
"unicorn/prefer-regexp-test",
|
|
837
|
+
"unicorn/prefer-string-replace-all",
|
|
838
|
+
"unicorn/prefer-string-slice",
|
|
839
|
+
"unicorn/prefer-top-level-await",
|
|
840
|
+
"unicorn/prefer-type-error",
|
|
841
|
+
"unicorn/require-number-to-fixed-digits-argument",
|
|
842
|
+
"jsdoc/require-param",
|
|
843
|
+
"jsdoc/require-param-description",
|
|
844
|
+
"jsdoc/require-param-name",
|
|
845
|
+
"jsdoc/require-param-type",
|
|
846
|
+
"jsdoc/require-returns",
|
|
847
|
+
"jsdoc/require-returns-description",
|
|
848
|
+
"jsdoc/require-returns-type",
|
|
849
|
+
"import-x/max-dependencies",
|
|
850
|
+
"@typescript-eslint/no-array-constructor",
|
|
851
|
+
"@typescript-eslint/no-loop-func",
|
|
852
|
+
"unicorn/no-negated-condition",
|
|
853
|
+
"@typescript-eslint/no-redeclare",
|
|
854
|
+
"vitest/no-conditional-in-test"
|
|
855
|
+
];
|
|
856
|
+
const suspiciousRules = [
|
|
857
|
+
"import/no-absolute-path",
|
|
858
|
+
"import/no-empty-named-blocks",
|
|
859
|
+
"import/no-named-as-default",
|
|
860
|
+
"import/no-named-as-default-member",
|
|
861
|
+
"import/no-self-import",
|
|
862
|
+
"import/no-unassigned-import",
|
|
863
|
+
"block-scoped-var",
|
|
864
|
+
"no-extend-native",
|
|
865
|
+
"no-extra-bind",
|
|
866
|
+
"no-new",
|
|
867
|
+
"no-unexpected-multiline",
|
|
868
|
+
"no-unneeded-ternary",
|
|
869
|
+
"no-useless-concat",
|
|
870
|
+
"no-useless-constructor",
|
|
871
|
+
"preserve-caught-error",
|
|
872
|
+
"@typescript-eslint/no-confusing-non-null-assertion",
|
|
873
|
+
"@typescript-eslint/no-extraneous-class",
|
|
874
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare",
|
|
875
|
+
"@typescript-eslint/no-unnecessary-template-expression",
|
|
876
|
+
"@typescript-eslint/no-unnecessary-type-arguments",
|
|
877
|
+
"@typescript-eslint/no-unnecessary-type-assertion",
|
|
878
|
+
"@typescript-eslint/no-unnecessary-type-constraint",
|
|
879
|
+
"@typescript-eslint/no-unsafe-enum-comparison",
|
|
880
|
+
"@typescript-eslint/no-unsafe-type-assertion",
|
|
881
|
+
"jest/no-commented-out-tests",
|
|
882
|
+
"react/iframe-missing-sandbox",
|
|
883
|
+
"react/jsx-no-comment-textnodes",
|
|
884
|
+
"react/jsx-no-script-url",
|
|
885
|
+
"react/no-namespace",
|
|
886
|
+
"react/react-in-jsx-scope",
|
|
887
|
+
"react/style-prop-object",
|
|
888
|
+
"unicorn/consistent-function-scoping",
|
|
889
|
+
"unicorn/no-accessor-recursion",
|
|
890
|
+
"unicorn/no-array-reverse",
|
|
891
|
+
"unicorn/no-array-sort",
|
|
892
|
+
"unicorn/no-instanceof-builtins",
|
|
893
|
+
"unicorn/prefer-add-event-listener",
|
|
894
|
+
"unicorn/require-module-specifiers",
|
|
895
|
+
"unicorn/require-post-message-target-origin",
|
|
896
|
+
"promise/always-return",
|
|
897
|
+
"promise/no-multiple-resolved",
|
|
898
|
+
"promise/no-promise-in-callback",
|
|
899
|
+
"vue/no-required-prop-with-default",
|
|
900
|
+
"vue/require-default-export",
|
|
901
|
+
"import-x/no-absolute-path",
|
|
902
|
+
"import-x/no-empty-named-blocks",
|
|
903
|
+
"import-x/no-named-as-default",
|
|
904
|
+
"import-x/no-named-as-default-member",
|
|
905
|
+
"import-x/no-self-import",
|
|
906
|
+
"import-x/no-unassigned-import",
|
|
907
|
+
"@typescript-eslint/no-useless-constructor",
|
|
908
|
+
"vitest/no-commented-out-tests"
|
|
903
909
|
];
|
|
904
910
|
const perfRules = [
|
|
905
911
|
"no-await-in-loop",
|
|
@@ -929,6 +935,7 @@ const rulesPrefixesForPlugins = {
|
|
|
929
935
|
react: "react",
|
|
930
936
|
"react-perf": "react-perf",
|
|
931
937
|
"react-hooks": "react",
|
|
938
|
+
"react-refresh": "react",
|
|
932
939
|
"@typescript-eslint": "typescript",
|
|
933
940
|
unicorn: "unicorn",
|
|
934
941
|
vitest: "vitest",
|
|
@@ -1108,10 +1115,12 @@ const transformRuleEntry = (eslintConfig, targetConfig, options) => {
|
|
|
1108
1115
|
if (allRules.includes(rule)) {
|
|
1109
1116
|
if (!options?.withNursery && nurseryRules.includes(rule)) {
|
|
1110
1117
|
options?.reporter?.report(`unsupported rule, but available as a nursery rule: ${rule}`);
|
|
1118
|
+
options?.reporter?.markSkipped(rule, "nursery");
|
|
1111
1119
|
continue;
|
|
1112
1120
|
}
|
|
1113
1121
|
if (!options?.typeAware && typescriptTypeAwareRules.includes(rule)) {
|
|
1114
1122
|
options?.reporter?.report(`type-aware rule detected, but \`--type-aware\` is not enabled: ${rule}`);
|
|
1123
|
+
options?.reporter?.markSkipped(rule, "type-aware");
|
|
1115
1124
|
continue;
|
|
1116
1125
|
}
|
|
1117
1126
|
if (options?.merge) {
|
|
@@ -1122,17 +1131,24 @@ const transformRuleEntry = (eslintConfig, targetConfig, options) => {
|
|
|
1122
1131
|
if (isOffValue(normalizedConfig)) {
|
|
1123
1132
|
if (eslintConfig.files === void 0) delete targetConfig.rules[rule];
|
|
1124
1133
|
else if (!isIgnoredPluginRule(rule)) targetConfig.rules[rule] = normalizedConfig;
|
|
1125
|
-
if (eslintConfig.files === void 0)
|
|
1134
|
+
if (eslintConfig.files === void 0) {
|
|
1135
|
+
options.reporter?.remove(unsupportedRuleMessage);
|
|
1136
|
+
options?.reporter?.removeSkipped(rule, "unsupported");
|
|
1137
|
+
}
|
|
1126
1138
|
continue;
|
|
1127
1139
|
}
|
|
1128
1140
|
if (enableJsPluginRule(targetConfig, rule, normalizedConfig)) continue;
|
|
1129
1141
|
}
|
|
1130
1142
|
if (!isActiveValue(normalizedConfig)) {
|
|
1131
1143
|
if (isOffValue(normalizedConfig)) delete targetConfig.rules[rule];
|
|
1132
|
-
if (eslintConfig.files === void 0)
|
|
1144
|
+
if (eslintConfig.files === void 0) {
|
|
1145
|
+
options?.reporter?.remove(unsupportedRuleMessage);
|
|
1146
|
+
options?.reporter?.removeSkipped(rule, "unsupported");
|
|
1147
|
+
}
|
|
1133
1148
|
continue;
|
|
1134
1149
|
}
|
|
1135
1150
|
options?.reporter?.report(unsupportedRuleMessage);
|
|
1151
|
+
options?.reporter?.markSkipped(rule, "unsupported");
|
|
1136
1152
|
}
|
|
1137
1153
|
}
|
|
1138
1154
|
};
|
|
@@ -1214,7 +1230,7 @@ const replaceTypescriptAliasRules = (config) => {
|
|
|
1214
1230
|
if (Object.keys(config.rules).length === 0) delete config.rules;
|
|
1215
1231
|
};
|
|
1216
1232
|
/**
|
|
1217
|
-
* Oxlint
|
|
1233
|
+
* Oxlint supports eslint-plugin-n rules only under the `node` plugin name
|
|
1218
1234
|
*/
|
|
1219
1235
|
const replaceNodePluginName = (config) => {
|
|
1220
1236
|
if (config.rules === void 0) return;
|
|
@@ -1225,6 +1241,19 @@ const replaceNodePluginName = (config) => {
|
|
|
1225
1241
|
delete config.rules[rule];
|
|
1226
1242
|
}
|
|
1227
1243
|
};
|
|
1244
|
+
/**
|
|
1245
|
+
* Oxlint supports the eslint-plugin-react-refresh/only-export-components rule
|
|
1246
|
+
* under the `react` plugin name.
|
|
1247
|
+
*/
|
|
1248
|
+
const replaceReactRefreshPluginName = (config) => {
|
|
1249
|
+
if (config.rules === void 0) return;
|
|
1250
|
+
for (const rule of Object.keys(config.rules)) {
|
|
1251
|
+
if (!rule.startsWith("react-refresh/")) continue;
|
|
1252
|
+
const reactRefreshRule = `react/${rule.slice(14)}`;
|
|
1253
|
+
config.rules[reactRefreshRule] = config.rules[rule];
|
|
1254
|
+
delete config.rules[rule];
|
|
1255
|
+
}
|
|
1256
|
+
};
|
|
1228
1257
|
|
|
1229
1258
|
//#endregion
|
|
1230
1259
|
//#region src/utilities.ts
|
|
@@ -1285,6 +1314,7 @@ const cleanUpOxlintConfig = (config) => {
|
|
|
1285
1314
|
transformBoolGlobalToString(config);
|
|
1286
1315
|
replaceTypescriptAliasRules(config);
|
|
1287
1316
|
replaceNodePluginName(config);
|
|
1317
|
+
replaceReactRefreshPluginName(config);
|
|
1288
1318
|
cleanUpRulesWhichAreCoveredByCategory(config);
|
|
1289
1319
|
if (config.globals !== void 0 && Object.keys(config.globals).length === 0) delete config.globals;
|
|
1290
1320
|
if (config.env !== void 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"commander": "^14.0.0",
|
|
40
40
|
"globals": "^17.0.0",
|
|
41
|
-
"oxc-parser": "^0.
|
|
41
|
+
"oxc-parser": "^0.110.0",
|
|
42
42
|
"tinyglobby": "^0.2.14"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@antfu/eslint-config": "^
|
|
45
|
+
"@antfu/eslint-config": "^7.0.0",
|
|
46
46
|
"@eslint/js": "^9.29.0",
|
|
47
47
|
"@logux/eslint-config": "^57.0.0",
|
|
48
48
|
"@oxc-node/core": "^0.0.35",
|
|
@@ -67,15 +67,16 @@
|
|
|
67
67
|
"eslint-plugin-react": "^7.37.5",
|
|
68
68
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
69
69
|
"eslint-plugin-react-perf": "^3.3.3",
|
|
70
|
-
"eslint-plugin-
|
|
70
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
71
|
+
"eslint-plugin-regexp": "^3.0.0",
|
|
71
72
|
"eslint-plugin-tsdoc": "^0.5.0",
|
|
72
73
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
73
74
|
"husky": "^9.1.7",
|
|
74
75
|
"jiti": "^2.4.2",
|
|
75
76
|
"lint-staged": "^16.1.2",
|
|
76
77
|
"next": "^16.0.0",
|
|
77
|
-
"oxfmt": "^0.
|
|
78
|
-
"oxlint": "^1.
|
|
78
|
+
"oxfmt": "^0.26.0",
|
|
79
|
+
"oxlint": "^1.42.0",
|
|
79
80
|
"oxlint-tsgolint": "^0.8.3",
|
|
80
81
|
"tsdown": "^0.19.0",
|
|
81
82
|
"typescript-eslint": "^8.35.0",
|