Skip to content

replace eslint with oxlint#4203

Draft
trevor-scheer wants to merge 58 commits intographql:mainfrom
trevor-scheer:trevor/replace-eslint-with-oxlint
Draft

replace eslint with oxlint#4203
trevor-scheer wants to merge 58 commits intographql:mainfrom
trevor-scheer:trevor/replace-eslint-with-oxlint

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 18, 2026

⚠️ No Changeset found

Latest commit: 5648845

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@trevor-scheer trevor-scheer force-pushed the trevor/replace-eslint-with-oxlint branch from 89728c1 to 669704a Compare April 19, 2026 00:00
@trevor-scheer trevor-scheer force-pushed the trevor/replace-eslint-with-oxlint branch 3 times, most recently from dab7a78 to 708c1a2 Compare April 19, 2026 00:36
JSON doesn't support comments; also this is a config file, not source code
First of 3 spread sites — inlining so we can remove the JS variable
Third and final spread site. The .filter() removed the monaco-editor
entry (it's replaced with a different message for this package).
All RESTRICTED_IMPORTS usages are now inlined, so we can drop the
variable. Also remove module.exports = { ... }; wrapper — the file
is now a plain object literal (still JS syntax, not yet valid JSON).
JSON doesn't support comments. Removed section headers, TODO notes,
inline explanations, and commented-out rules.
JSON requires double-quoted keys. Used sd to add quotes to all
bare JS identifiers used as object keys.
JSON requires double quotes. Fixed the apostrophe in "can't" that
got caught in the replacement.
JSON doesn't allow trailing commas. The file is now valid JSON.
eslint-only option; oxlint always behaves as if root is true
eslint-only option; oxlint reports unused disable directives by default
eslint-only concept; oxlint uses plugins array instead, which
enables recommended rules for each plugin automatically
eslint-only; oxlint uses its own parser and doesn't need ecmaVersion
oxlint uses a flat plugins list to enable rule sets. This replaces
the eslint extends mechanism. Includes typescript, react, import,
unicorn, promise, jest, and vitest.
oxlint env is a top-level config option, not per-override
oxlint globals is a top-level config option
oxlint settings (like react version detection) is a top-level option
The first override matched all code files (**.{js,jsx,ts,tsx,mts,cts})
so it was effectively global. Rules now live at the top level where
oxlint expects them. The override's plugins list is removed (handled
by the top-level plugins array added earlier).
oxlint uses "readonly"/"writable" strings instead of eslint's
false/true booleans for global variable declarations
oxlint uses the shorter "typescript/" prefix for TypeScript rules
oxlint uses "import/" for import-related rules (eslint used the
import-x fork plugin)
The earlier structural moves left inconsistent indentation in the
overrides section. Re-formatted via json.dump for consistency.
These are all no-ops in oxlint — rules default to off unless enabled
by a plugin. Includes eslint core rules, @Shopify, react/prop-types,
typescript/no-require-imports, import/no-named-as-default-member,
and a few unicorn rules that were explicitly disabled.
@trevor-scheer trevor-scheer force-pushed the trevor/replace-eslint-with-oxlint branch from 708c1a2 to 78c1008 Compare April 19, 2026 01:05
partial replacement — only covers redundant return, not break/continue
no-catch-shadow, no-mixed-requires, no-new-object, no-octal-escape,
no-restricted-properties, no-restricted-syntax, no-return-await, one-var,
prefer-arrow-callback, quotes, spaced-comment, logical-assignment-operators
— will recover some via eslint-js jsPlugin later
react/no-did-update-set-state, react/no-unused-state, react/prefer-stateless-function
…ot supported by oxlint

also removes overrides that existed solely to configure these rules
unicorn/consistent-destructuring, unicorn/no-array-push-push,
unicorn/prefer-export-from, unicorn/prefer-switch
oxlint doesn't support allow-null; smart is the closest equivalent
(allows == for null checks plus a few other safe comparisons)
oxlint can't auto-detect the React version from package.json
extends (cypress, jest), parserOptions (typescript), parser + processor (mdx)
— these are eslint concepts with no oxlint equivalent
oxlint doesn't support excludedFiles in overrides. Replaced with explicit
files lists that cover the same packages (minus the excluded ones). Dropped
the mdx excludedFiles since oxlint doesn't process mdx anyway.
not in oxlint's native react plugin — will recover via jsPlugins later
these rules are enabled by default when their plugin is loaded in oxlint
but weren't in the eslint config, so disable to avoid new warnings
moved from .oxlintrc.json ignorePatterns since oxlint uses --ignore-path instead
removes 15 eslint-related packages, adds oxlint + oxlint-tsgolint.
updates eslint -> oxlint in all script references.
.eslintrc.js -> .oxlintrc.json in ignorePaths, add oxlint/oxlintrc to dictionary
eslint-js bridges core eslint rules, react-hooks-js bridges react-compiler
prefer-arrow-callback, object-shorthand, one-var, operator-assignment,
logical-assignment-operators, no-octal-escape, no-return-await,
spaced-comment, quotes
refs and set-state-in-effect disabled (stricter than old rule, pre-existing
violations). native duplicates (rules-of-hooks, exhaustive-deps) disabled
since they're already covered by oxlint's built-in react-hooks plugin.
@trevor-scheer trevor-scheer force-pushed the trevor/replace-eslint-with-oxlint branch from 342e613 to 33aacd7 Compare April 19, 2026 21:10
- fix react-hooks-js rule names: react-hooks v6 uses flat names
  (refs, set-state-in-effect, purity, etc.), not nested react-compiler/ prefix
- set sonarjs replacement rules (no-void, no-useless-assignment,
  no-useless-return) to off — they catch real violations the sonarjs
  rules didn't, needs separate cleanup PR
- add "run" to jest/expect-expect assertFunctionNames
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.

1 participant