Repository navigation
Switch to TypeScript 7 (tsgo) and replace ESLint with oxlint - #6354
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6354 +/- ##
=======================================
Coverage 84.78% 84.78%
=======================================
Files 358 358
Lines 38946 38946
Branches 11019 11033 +14
=======================================
Hits 33022 33022
Misses 5488 5488
Partials 436 436 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bc43c93 to
c197b2c
Compare
canova
left a comment
There was a problem hiding this comment.
Thanks! It looks mostly good to me, I added some comments below.
Also about the top comment of .oxlintrc.json, I'm not a big fan of the old ESLint config references in there. Currently the comment reads more like a migration history. Some things might be worth keeping with some rewording but I would prefer if the migration details live inside the commit message instead. Let me know what you think! Also I think we can trim down the commit message as well.
59247af to
2bfa865
Compare
TypeScript 7 is the native Go port of the compiler. It ships only the
`tsc` binary. Its JavaScript compiler API won't return until 7.1, and
typescript-eslint refuses to load without it. So both switches have to
happen together.
Timings on this machine, from a cold cache:
yarn ts 4.83s -> 1.04s
yarn lint-js 11.00s -> 1.93s
yarn lint 14.03s -> 2.98s
The rules in .oxlintrc.json were derived from the effective configuration
of the old eslint.config.mjs. Every lint category is switched off and each
rule is listed explicitly. Enabling a category would turn on rules that
ESLint didn't enforce.
Rules that oxlint doesn't implement natively come from the original ESLint
plugins, loaded through `jsPlugins` in the same oxlint pass:
eslint-plugin-testing-library 20 rules
eslint-plugin-jest-dom 11 rules
eslint-plugin-react 7 rules, loaded as `react-js`
eslint-plugin-jest-formatting padding-around-describe-blocks
eslint-plugin-import no-unresolved, for JavaScript files
only, loaded as `import-js`
oxlint implements consistent-return and dot-notation only as type-aware
rules, which can't run on JavaScript files. A small local plugin,
scripts/lib/oxlint-eslint-core-rules.mjs, applies ESLint's own versions
to .js, .mjs and .cjs files.
In TypeScript files, tsc already reports unresolved imports (TS2307).
`eslint` stays a devDependency because these plugins import it. Nothing
runs the ESLint CLI.
These rules are not carried over:
- no-invalid-this. In TypeScript files, tsc reports the same problem
(TS2683). ESLint's implementation crashes under oxlint, so it doesn't
run on JavaScript files. Only one of those uses `this`.
- react/no-did-mount-set-state and react/no-did-update-set-state.
eslint-plugin-react makes them no-ops for React 16.3 and newer.
- no-return-await, which ESLint has deprecated. typescript/return-await
in `error-handling-correctness-only` mode replaces it. It only reports
an `await` that changes which errors a surrounding try/catch sees.
Both linters were run over a corpus of 57 files with one defect each, one
per rule. oxlint catches everything ESLint caught, with no false
positives.
eslint-disable comments for jsPlugins rules are renamed to the names
oxlint reports. One jest/no-conditional-expect disable comment is
removed: oxlint's version of the rule misses `function () {}` test
callbacks, so the comment counted as unused. This is
oxc-project/oxc#28054.
2bfa865 to
fe37b88
Compare
Changes: [Markus Stange] Accept more fields from symbolication. (#6373) [Markus Stange] Support index source maps. (#6399) [fatadel] Make CompositorScreenshot markers schema-based (#6261) [Markus Stange] Use inverted transforms in the tests for inverted call node paths. (#6393) [fatadel] Expose and clear URL-imported call tree search in the CLI (#6387) [Markus Stange] Make the scrollable editor view in the source view cover the full height of the panel, even if the source code is short. (#6405) [Nazım Can Altınova] Silence profile loader logs in profile-querier-url tests (#6409) [Nazım Can Altınova] Add `--js-sources-from-func-names` to `profiler-edit` (#6394) [Nazım Can Altınova] Look for a source file's address proof in all of its frames (#6407) [Markus Stange] Some preparations for a function list panel (#6401) [fatadel] Use fractional seconds with adaptive precision for CLI marker timestamps (#6384) [fatadel] 🔃 Sync: l10n -> main (October 22, 2026) (#6415) [Markus Stange] Switch to TypeScript 7 (tsgo) and replace ESLint with oxlint (#6354) [fatadel] Bump profiler-cli version to 0.12.0 (#6416) And special thanks to our localizers: el: Jim Spentzos uk: Lobodzets, uya2521, Іhor Hordiichuk
Main | Deploy preview
TypeScript 7 has a faster compiler but eslint isn't compatible with it. But we can switch to oxlint instead; oxlint has many of the lints we use built-in, and for the rest (testing-library, jest-dom) it has a
jsPluginadapter.Timings on my machine, from a cold cache:
Two notes:
error-handling-correctness-onlymode, which reports only where adding or removingawaitchanges which errors a try/catch sees. That is a narrower rule, and it is what found the bug fixed in Add missing await when calling Chrome importer #6346.The eslint-disable comments for rules loaded through jsPlugins are renamed to the oxlint names.
jsPlugins is documented as alpha and not covered by semver, so an oxlint upgrade may require revisiting this file.