Skip to content

Replace eslint with oxlint#4203

Merged
trevor-scheer merged 65 commits into
graphql:mainfrom
trevor-scheer:trevor/replace-eslint-with-oxlint
May 6, 2026
Merged

Replace eslint with oxlint#4203
trevor-scheer merged 65 commits into
graphql:mainfrom
trevor-scheer:trevor/replace-eslint-with-oxlint

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer commented Apr 18, 2026

Sorry it's a ton of commits, the hope was that the changes are intelligible since it's a pretty big overhaul.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 18, 2026

⚠️ No Changeset found

Latest commit: 7645357

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
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
@trevor-scheer trevor-scheer marked this pull request as ready for review May 6, 2026 18:34
Removes:
- duplicates: `object-shorthand`, `operator-assignment` (kept the `eslint-js/*` versions)
- formatter overlap (oxfmt owns these): `eslint-js/quotes`, `eslint-js/spaced-comment`, `unicorn/no-zero-fractions`
- dead-era React: `react/no-did-mount-set-state`, `react/prefer-es6-class`
- low-signal: `unicorn/no-array-for-each`, `unicorn/no-negated-condition`, `prefer-destructuring` (half-applied), `no-await-in-loop` (frequent false positives)
Was scoped to `packages/{graphiql,graphiql-react}`. Promotes to all TS files; codebase is currently free of violations under the broader scope.
Documents rules we'd like to enforce eventually but currently violate the codebase. Each TODO records the approximate violation count so progress is visible.

Also drops the per-package `typescript/no-unnecessary-condition` override; that rule is silently a no-op without `--type-aware` mode and is now consolidated globally with the same TODO.
@trevor-scheer trevor-scheer changed the title replace eslint with oxlint Replace eslint with oxlint May 6, 2026
The job describes what runs (linting), independent of the underlying tool.
@trevor-scheer trevor-scheer enabled auto-merge (squash) May 6, 2026 19:21
@trevor-scheer trevor-scheer merged commit 2d9e03b into graphql:main May 6, 2026
13 checks passed
@trevor-scheer trevor-scheer deleted the trevor/replace-eslint-with-oxlint branch May 6, 2026 19:22
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