Migrate from ESLint to oxlint - #767
Open
veksa wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for reselect-docs canceled.
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This swaps ESLint out for oxlint. The main motivation is the upcoming move to TypeScript 7 (typescript-go): the
@typescript-eslinttoolchain is tied to the TypeScript compiler API and becomes a blocker there, whereas oxlint is a standalone Rust linter that doesn't depend on it. It's also dramatically faster and drops a large chunk of the dependency tree — installing this branch removes around 150 transitive packages.What changed
The old
.eslintrcand.eslintignoreare gone, replaced by a single.oxlintrc.json. It turns on thecorrectnesscategory as errors and keeps the two rules the project actually relied on:consistent-type-imports(withseparate-type-imports, same as before) and the relaxations for test and example files. Thelintscript now runsoxlint src test, and all the@typescript-eslint/eslint/eslint-plugin-*dev dependencies are replaced by a singleoxlintentry. The few inlineeslint-disablecomments were rewritten to theoxlint-disableequivalents.Code fixes
oxlint's
correctnesscategory is stricter thaneslint:recommended, so the migration surfaced 44 findings. I fixed all of them in place rather than silencing rules:src: replaced theObjectwrapper type withobjectinweakMapMemoize, dropped the redundant parameter-property assignments inproxy, and turned thex !== 0 && x--short-circuits into plainifstatements.test: the Chai getter-style assertions (.that.is.not.empty,.to.be.true) were rewritten to their callable forms so they no longer look like unused expressions, without re-evaluating any selector (so recomputation counts stay intact). The bare property reads in the benchmarks now feed a sink variable, and a couple of dead expression statements were tidied up.Follow-up:
consistent-type-exportsneeds TypeScript 7The old config also had
@typescript-eslint/consistent-type-exportsenabled. In oxlint that rule is only available through type-aware linting, which requires TypeScript 7 (typescript-go) and theoxlint-tsgolintpackage. I left it out for now because typescript-go rejects the current tsconfigs —moduleResolution: "Node"(node10) andbaseUrlhave been removed in TS7, and thepathsentries need to be relative. There's aTODO(ts7)in.oxlintrc.jsondescribing exactly what to add once the tsconfigs are migrated, so restoring the rule is a small follow-up on top of the TS7 work.