Repository navigation
ci: Switch from ESLint to Oxlint - #1428
dangotbanned wants to merge 14 commits into
Conversation
auto-generated from existing ESLint config https://oxc.rs/docs/guide/usage/linter/migrate-from-eslint.html#migrating-from-an-eslint-flat-config
The `.js` lints have been fixed in the `.ts` PRs https://github.com/uwdata/mosaic/stack/1375
Anything left that's not `"error"` comes from a different category - https://oxc.rs/docs/guide/usage/linter/rules.html?sort=name&dir=asc&category=correctness&scope=eslint - https://oxc.rs/docs/guide/usage/linter/rules.html?sort=name&dir=asc&category=correctness&scope=typescript
includes 2 more groups https://oxc.rs/docs/guide/usage/linter/config.html#configure-plugins
already present in `lib.es5.d.ts
they weren't at all reported previously
- Was only added in (#1266), but the rule is deprecated - https://eslint.org/blog/2023/10/deprecating-formatting-rules/ - `oxlint` doesn't have it - `oxfmt` diff is too noisy to add here
`test.yml` depends on `"lint"` as a gate
it ain't much but it's something
What do you mean by "begin"?The singular hiccup I encountered is due to there being no equivalent to the quotes rule added in (#1266) to enforce single quotes. Per the ESLint rule documentation: This rule was deprecated in ESLint v8.53.0.
Oxlint is not intending to implement deprecated rules. I absolutely want to introduce Oxfmt as well (#1364 (comment)), but in this PR I was aiming for a minimal change. Temporary solutionOxlint has docs for what to do in this pickle, so I've stripped ESLint down to just checking that single rule after running Oxlint. Full solution
|
| "categories": { | ||
| "correctness": "error", | ||
| }, |
There was a problem hiding this comment.
This category + the tweaks in "rules" is a superset of the old config, without introducing new errors/warns on existing code.
I want to do follow-up PRs with enabling more, since this is only 115/875 rules.
Not everything is relevant, but there are many things I've found make for an easier read 🙂
| "format": "lerna run format && eslint dev bin", | ||
| "format:fix": "lerna run format -- --fix && eslint --fix dev bin", | ||
| "lint": "pnpm oxlint && pnpm format", | ||
| "lint:fix": "pnpm oxlint --fix && pnpm format:fix", |
There was a problem hiding this comment.
This is awkward. In the future, I definitely want to get rid of the format/lint distinction. When you have the oxfmt pull request up, I can merge it quickly as long as it doesn't change a ton of formatting for a worse version.
Description
This PR begins (see #1428 (comment)) a transition from ESLint to a considerably faster alternative (Oxlint).
How much faster?
Measured after checking out the branch and running
pnpm testto warm upmain(10.7s)Show output
This PR (29ms)
Show output
That 29ms is over before Lerna has even printed lerna notice cli v10.1.2 😅
What's changed?
pnpm lintcontinues on as a CI gatepnpm format,pnpm format:fixdeal with the awkwardness of (ci: Switch from ESLint to Oxlint #1428 (comment))