Skip to content

Commit 3d1e992

Browse files
Preserve source and legacy suppressions during Oxlint migration
1 parent eb015fa commit 3d1e992

183 files changed

Lines changed: 630 additions & 483 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎configurations/oxlint-rule-mapping.json‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@nx/enforce-module-boundaries": {
3-
"replacement": "@shopify/cli/module-boundaries",
3+
"replacement": "compat/nx-enforce-module-boundaries",
44
"status": "partial",
55
"limitation": "Relative cross-project imports and re-exports are checked. Nx graph cycles, tag constraints, lazy-loading checks and buildability checks are not retained."
66
},
@@ -97,7 +97,7 @@
9797
"limitation": "The specialized Shopify rule is not ported."
9898
},
9999
"@shopify/strict-component-boundaries": {
100-
"replacement": "@shopify/cli/module-boundaries",
100+
"replacement": "compat/nx-enforce-module-boundaries",
101101
"status": "partial",
102102
"limitation": "Relative imports between projects are rejected. Resolver-based component entrypoint checks are not retained."
103103
},
@@ -147,9 +147,9 @@
147147
"limitation": "Independent syntax check covers repository conventions, not the complete upstream rule API."
148148
},
149149
"@typescript-eslint/naming-convention": {
150-
"replacement": "@shopify/cli/naming-convention",
150+
"replacement": "compat/typescript-eslint-naming-convention",
151151
"status": "partial",
152-
"limitation": "Configured declaration, parameter, property and type names are checked. Type filters, all upstream selectors and modifier precedence are not implemented."
152+
"limitation": "Configured declaration, parameter, property and type names are checked. Type filters, all upstream selectors and modifier precedence are not implemented. Inferred type parameters keep their existing names; naming enforcement applies to declared type parameters."
153153
},
154154
"@typescript-eslint/no-array-constructor": {
155155
"replacement": "no-array-constructor",
@@ -197,9 +197,9 @@
197197
"limitation": "Native behavior and option support may differ from ESLint."
198198
},
199199
"@typescript-eslint/no-unnecessary-type-assertion": {
200-
"replacement": "typescript/no-unnecessary-type-assertion",
201-
"status": "native",
202-
"limitation": "Native behavior and option support may differ from ESLint."
200+
"replacement": null,
201+
"status": "unsupported",
202+
"limitation": "Disabled during migration because the native checker flags assertions accepted by the original ESLint setup, including intentional test fixtures. Existing casts are retained; there is no exact compatibility option."
203203
},
204204
"@typescript-eslint/no-unnecessary-type-constraint": {
205205
"replacement": "typescript/no-unnecessary-type-constraint",
@@ -372,7 +372,7 @@
372372
"limitation": "Native behavior and option support may differ from ESLint."
373373
},
374374
"id-length": {
375-
"replacement": "@shopify/cli/id-length",
375+
"replacement": "compat/id-length",
376376
"status": "partial",
377377
"limitation": "Independent syntax check covers repository conventions, not the complete upstream rule API."
378378
},
@@ -452,14 +452,14 @@
452452
"limitation": "Native behavior and option support may differ from ESLint."
453453
},
454454
"import-x/no-named-as-default": {
455-
"replacement": "import/no-named-as-default",
456-
"status": "native",
457-
"limitation": "Native behavior and option support may differ from ESLint."
455+
"replacement": null,
456+
"status": "unsupported",
457+
"limitation": "Disabled during migration because native module analysis flags existing default WebSocket imports accepted by ESLint. Existing imports are retained; this check is currently lost."
458458
},
459459
"import-x/no-named-as-default-member": {
460-
"replacement": "import/no-named-as-default-member",
461-
"status": "native",
462-
"limitation": "Native behavior and option support may differ from ESLint."
460+
"replacement": null,
461+
"status": "unsupported",
462+
"limitation": "Disabled during migration because native module analysis flags existing Prettier and CommonJS GraphQL-loader access accepted by ESLint. Existing imports are retained; this check is currently lost."
463463
},
464464
"import-x/no-named-default": {
465465
"replacement": "import/no-named-default",
@@ -787,7 +787,7 @@
787787
"limitation": "Independent syntax check covers repository conventions, not the complete upstream rule API."
788788
},
789789
"n/prefer-global/console": {
790-
"replacement": "@shopify/cli/prefer-global-console",
790+
"replacement": "compat/n-prefer-global-console",
791791
"status": "partial",
792792
"limitation": "Independent syntax check covers repository conventions, not the complete upstream rule API."
793793
},
@@ -807,7 +807,7 @@
807807
"limitation": "Independent syntax check covers repository conventions, not the complete upstream rule API."
808808
},
809809
"n/prefer-global/url": {
810-
"replacement": "@shopify/cli/prefer-global-url",
810+
"replacement": "compat/n-prefer-global-url",
811811
"status": "partial",
812812
"limitation": "Independent syntax check covers repository conventions, not the complete upstream rule API."
813813
},
@@ -867,7 +867,7 @@
867867
"limitation": "Native behavior and option support may differ from ESLint."
868868
},
869869
"no-catch-all/no-catch-all": {
870-
"replacement": "@shopify/cli/no-catch-all",
870+
"replacement": "no-catch-all/no-catch-all",
871871
"status": "retained"
872872
},
873873
"no-catch-shadow": {
@@ -1191,7 +1191,7 @@
11911191
"limitation": "Native behavior and option support may differ from ESLint."
11921192
},
11931193
"no-restricted-syntax": {
1194-
"replacement": "@shopify/cli/restricted-syntax",
1194+
"replacement": "compat/no-restricted-syntax",
11951195
"status": "partial",
11961196
"limitation": "Independent syntax check covers repository conventions, not the complete upstream rule API."
11971197
},
@@ -1496,7 +1496,7 @@
14961496
"limitation": "Native behavior and option support may differ from ESLint."
14971497
},
14981498
"tsdoc/syntax": {
1499-
"replacement": "@shopify/cli/tsdoc-syntax",
1499+
"replacement": "tsdoc/syntax",
15001500
"status": "partial",
15011501
"limitation": "Uses the same TSDoc parser with its default configuration. Per-directory tsdoc.json loading is not implemented; this repository has no such file."
15021502
},

‎docs/cli/oxlint-rule-coverage.md‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Consumers must configure those separately. This is a breaking public config chan
1515

1616
The original configuration at `656de9379cb7b4e2af6fe0bc6c8d81b1a50163f7` enabled
1717
301 lint rule names plus `prettier/prettier`. The migration has replacements for
18-
246 lint rule names: 197 native counterparts, 14 retained implementations, and
18+
243 lint rule names: 194 native counterparts, 14 retained implementations, and
1919
35 partial independent replacements. Prettier covers formatting separately.
20-
There are 55 rule names without a dedicated replacement. Of those, 11 have
20+
There are 58 rule names without a dedicated replacement. Of those, 11 have
2121
identified coverage or overlap elsewhere in the existing toolchain. These are
22-
not 55 wholly missing capabilities, and overlap does not establish full parity.
22+
not 58 wholly missing capabilities, and overlap does not establish full parity.
2323

2424
The independent plugin in `packages/eslint-plugin-cli/oxlint.js` adds naming,
2525
member ordering, identifier length, import ordering, project boundaries, unused
@@ -36,9 +36,18 @@ fixes for contiguous imports without comments or side effects. Public parameter
3636
return documentation checks cover directly exported functions; destructured parameter
3737
paths and full export reachability are not equivalent to the original JSDoc rules.
3838

39-
Native rules can report additional cases, including unnecessary type assertions
40-
and ambiguous default imports. Existing code and directives are updated for these
41-
diagnostics. Unused imports in tests remain checked even though unused local variables
39+
To keep the migration small, existing type assertions and default imports are
40+
preserved. The native `typescript/no-unnecessary-type-assertion`,
41+
`import/no-named-as-default`, and `import/no-named-as-default-member` checks are
42+
disabled because they report existing code accepted by ESLint and have no exact
43+
compatibility option. These are three explicit coverage gaps, not equivalent
44+
replacements. Declared type parameters keep their naming checks; inferred type
45+
parameter names retain their existing spelling.
46+
47+
Small dependency-free alias plugins preserve the existing `compat/*`,
48+
`no-catch-all/no-catch-all`, and `tsdoc/syntax` suppression names. They call the
49+
independent implementations and do not load ESLint or upstream plugins. Obsolete
50+
and unused suppressions are removed. Unused imports in tests remain checked even though unused local variables
4251
are allowed. Import-removal fixes differ from the original dedicated plugin.
4352

4453
## Coverage from other existing tools
@@ -89,9 +98,9 @@ The complete rule-by-rule mapping and limitations are in
8998

9099
| Family | Remaining checks |
91100
| --- | --- |
92-
| Import analysis | Deprecated imports and redundant path segments; resolution, dependency, and unused-export coverage outside Knip/compiler scopes |
101+
| Import analysis | Deprecated imports, redundant path segments, and ambiguous default-import checks; resolution, dependency, and unused-export coverage outside Knip/compiler scopes |
93102
| JSDoc | Advanced tag/type validation, parameter path matching, return/throw/yield consistency, layout beyond Prettier |
94-
| Control flow | Consistent returns, atomic updates, early-return conventions |
103+
| Control flow and assertions | Consistent returns, atomic updates, early-return conventions, redundant type assertions |
95104
| Node APIs | Deprecated or unsupported APIs, callback conventions, promise API preferences, executable/shebang checks |
96105
| Shopify conventions | Image imports, context menus, module-scope constants, Twine, singular enum names |
97106
| Style and directives | Camel case in JavaScript, line-comment placement, statement padding, class sorting, explicit strict-directive policy, directive conventions beyond unused suppressions |

0 commit comments

Comments
 (0)