Skip to content

Migrate linting from ESLint + oxlint to single oxlint config#167

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/migrate-to-oxlint-configuration
Draft

Migrate linting from ESLint + oxlint to single oxlint config#167
Copilot wants to merge 7 commits intomainfrom
copilot/migrate-to-oxlint-configuration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

Replaces the dual ESLint + oxlint setup with a single oxlint.config.ts. ESLint and all its associated packages are removed. Rules that oxlint can't cover natively are handled via oxlint's JS plugin support.

Strategy

  • Categories over explicit rules: correctness: "error" and suspicious: "warn" replace ~100 individually listed rules.
  • Native plugins: typescript and react (which includes react-hooks) cover TypeScript and React rule sets natively.
  • JS plugins for gaps: Two plugins have no native oxlint equivalent and are loaded as JS plugins:
    • eslint-plugin-react-hooks (v7 absorbed the React Compiler rules from the now-removed eslint-plugin-react-compiler)
    • @tanstack/eslint-plugin-query

react-hooks alias requirement

react-hooks is a reserved name in oxlint (bundled into the native react plugin), so the JS plugin must be aliased:

jsPlugins: [
    { name: "react-hooks-js", specifier: "eslint-plugin-react-hooks" },
    "@tanstack/eslint-plugin-query",
],

Rules derived from plugin recommended configs

Instead of hardcoding individual rules, both JS plugins' recommended configs are spread dynamically. The rules block contains only overrides:

rules: {
    ...reactHooksRecommendedRules,   // from flat/recommended-latest, prefix remapped
    ...tanstackQueryRecommendedRules, // from flat/recommended
    "react/react-in-jsx-scope": "off",       // new JSX transform
    "react-hooks-js/exhaustive-deps": "off", // already covered natively as react/exhaustive-deps
},

Validation guards throw if either extraction produces an empty rule set, catching plugin API changes early.

Coverage gaps vs. original ESLint

Area Status
Type-aware TypeScript rules (strictTypeChecked) ❌ oxlint doesn't support type-aware analysis; tsc still enforces type safety
react-refresh/only-export-components ❌ no oxlint equivalent
@typescript-eslint/no-deprecated ❌ type-aware

Levers for adjusting rule coverage

Goal How
Fewer rules Remove suspicious: "warn"; or turn off specific rules
More native rules Add to plugins: "import", "promise", "unicorn", "jsx-a11y", "react-perf", "node"
React perf hints Add "react-perf" to plugins + perf: "warn" to categories (expect many warnings on inline JSX)
More ESLint plugins Add to jsPlugins — any ESLint v9-compatible plugin works
Stricter Promote suspicious: "warn""error"

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 19, 2026

Deploying rainbow with  Cloudflare Pages  Cloudflare Pages

Latest commit: e1e767a
Status: ✅  Deploy successful!
Preview URL: https://e69c3435.rainbow-ctx.pages.dev
Branch Preview URL: https://copilot-migrate-to-oxlint-co.rainbow-ctx.pages.dev

View logs

Copilot AI changed the title [WIP] Migrate to best-practice oxlint configuration with rule-coverage Migrate linting to oxlint with matching ESLint rule coverage Mar 19, 2026
Copilot AI requested a review from Amund211 March 19, 2026 15:17
Copilot AI and others added 2 commits March 19, 2026 15:33
Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
Copilot AI changed the title Migrate linting to oxlint with matching ESLint rule coverage Replace ESLint with single oxlint config using categories and JS plugins Mar 19, 2026
Copilot AI and others added 3 commits March 19, 2026 16:06
… spreading

Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
…react-compiler

Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
… guards, clean up test files

Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
Copilot AI changed the title Replace ESLint with single oxlint config using categories and JS plugins Migrate linting from ESLint + oxlint to single oxlint config Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants