Skip to content

chore: Replace ESLint with oxlint - #618

Open
torokati44 wants to merge 1 commit into
ruffle-rs:masterfrom
torokati44:forget-eslint
Open

torokati44 wants to merge 1 commit into
ruffle-rs:masterfrom
torokati44:forget-eslint

Conversation

@torokati44

Copy link
Copy Markdown
Member

Motivation: jsx-eslint/eslint-plugin-react#3977 not progressing.
This should unblock switching to TypeScript 7 (#607)

I will admit this whole thing was done by AI, including the rest of this message.


eslint-config-next pulls in eslint-plugin-react, -import and -jsx-a11y, which are unmaintained and don't support ESLint 10, causing peer dependency warnings. ESLint 10 and typescript-eslint also depend on a vulnerable minimatch (GHSA-g3hv-75wg-m249).

oxlint has built-in ports of the rules we used (eslint:recommended, typescript-eslint recommended, @next/next core-web-vitals) plus react-hooks, including the React Compiler rules. The config enables the default correctness category and the remaining rules from the old setup.

eslint-config-next pulls in eslint-plugin-react, -import and -jsx-a11y,
which are unmaintained and don't support ESLint 10, causing peer
dependency warnings. ESLint 10 and typescript-eslint also depend on a
vulnerable minimatch (GHSA-g3hv-75wg-m249).

oxlint has built-in ports of the rules we used (eslint:recommended,
typescript-eslint recommended, @next/next core-web-vitals) plus
react-hooks, including the React Compiler rules. The config enables the
default correctness category and the remaining rules from the old setup.
@torokati44

Copy link
Copy Markdown
Member Author

Looks like this already caught a lint:

react-hooks(exhaustive-deps): src/components/logo.tsx#L72
src/components/logo.tsx:72:18: React Hook useEffect has a missing dependency: 'removeRufflePlayer'

I have a commit ready that fixes this (of course also written by AI).

@danielhjacobs

danielhjacobs commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

I don't feel totally comfortable reviewing this myself as I'm completely unfamiliar with oxlint, but did the AI mention if it used https://oxc.rs/docs/guide/usage/linter/migrate-from-eslint.html?

Comment thread package.json
"build": "next build",
"start": "next start",
"lint": "eslint .",
"lint": "oxlint",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want oxlint --deny-warnings instead?

@torokati44

Copy link
Copy Markdown
Member Author

@danielhjacobs It said:


No, I didn't use it the first time. Having now read it and run its converter (@oxlint/migrate) on the old ESLint config, it mostly confirms what's on the branch, plus two things worth knowing.

What the converter confirms

  • Same skipped rules: it skipped the same 5 rules I'd found by hand:
    • no-undef and no-useless-assignment (oxlint ships them as experimental, "nursery", rules)
    • @next/next/no-location-assign-relative-destination (not implemented yet)
    • no-dupe-args and no-octal (won't be implemented)
  • One deliberate difference: I turned no-undef on anyway for the two JS config files, and it works there.
  • Its output has a bug: it produced an override with "files": [null]. It lost the TypeScript file pattern from typescript-eslint's settings, so that config would need fixing by hand anyway.
  • Ignores: it copies the old ESLint ignore list. I didn't need to, because oxlint respects .gitignore and every one of those paths is already in it.

Where the branch's config is stricter than the converter's

  • It doesn't list only the old 104 rules. It turns on oxlint's whole correctness category, about 220 rules, including the React hooks rules.
  • All 21 Next.js rules are errors. Next's own preset had 15 of them as warnings, and the converter kept that. There are no violations today, so this only matters for future code. I'd keep it stricter, but making those 15 warnings again is a few lines if you want exact parity.

Useful new points

  1. CI annotations: oxlint detects GitHub Actions and automatically emits inline PR annotations. So npm run lint in test.yml now puts lint findings on the PR diff without any changes.
  2. Type-aware linting: with oxlint --type-aware and the oxlint-tsgolint package, built on TypeScript 7, you can get rules that use type information, like no-floating-promises. The old setup never had those, so this would be a new capability, not a migration gap. It's a natural follow-up once build(deps-dev): bump typescript from 6.0.3 to 7.0.2 #607 lands.

The rest doesn't apply here: running alongside ESLint, JS plugins for unsupported plugins, and converting old-style ESLint configs.

This branch has not been deployed

No deployments
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