/posts/announcing-oxlint-type-aware-linting.md
For more technical details, implementations, and considerations for Oxlint's type-aware linting, see the blog post on the Oxc website.
TL;DR: Oxlint with type-aware linting is now available and supports 40 long-awaited rules including no-floating-promises
. Oxlint uses tsgolint
, which @auvred initially prototyped as typescript-eslint/tsgolint
and generously offered to continue its development under the Oxc organization.
The VoidZero team is excited to announce that oxlint
has taken a big step towards being a full-fledged Rust-based linting replacement with type-aware linting. This release unlocks 40 long-awaited rules including no-floating-promises
.
Type-aware linting has been one of the biggest feature gaps for native linters like oxlint
. Traditional lint rules only review one file at a time, which is fast and parallelizable. However, type-aware lint rules call TypeScript’s types API to infer types, which may require reviewing every file. As a result, type-aware lint rules are more capable than traditional lint rules, but slower.
oxlint
’s first approach to solving type-aware linting’s slow performance was implementing its own type-checker. After multiple attempts, this approach was abandoned because maintaining a type-checker on par with a fast-moving target like TypeScript is not feasible.
Other approaches, like TypeScript inter-process communication, were also considered and abandoned. The key to unlocking type-aware lint rules turned out to be TypeScripts native Go port and tsgolint
.
The tsgolint
project is an experimental type-aware linter written in Go and initially prototyped by @auvred as typescript-eslint/tsgolint. However, the typescript-eslint
team decided not to allocate development resources to this prototype, as they plan to continue their work on typescript-eslint
for typed linting with ESLint.
The VoidZero team contacted @auvred for a forked, scoped-down version adapted for oxlint
. In a true “standing on the shoulder of giants” moment, @auvred generously offered to continue its development under oxc-project/tsgolint.
Initial oxlint
with type-aware linting tests show repositories that previously took 1 minute to run with typescript-eslint
now finish in <10 seconds.
Using projects from oxlint-ecosystem-ci:
Project | Files | Time |
---|---|---|
napi-rs | 144 | 1.0s |
preact | 245 | 2.7s |
rolldown | 314 | 1.5s |
bluesky | 1152 | 7.0s |
The VoidZero team will continue to develop and improve upon tsgolint
. For v1.0 release, we will:
The VoidZero team would like to extend our gratitude to:
typescript-go
.typescript-eslint
team for their heartwarming support.tsgolint
.oxlint
+ tsgolint
integration.The VoidZero team would love to hear your feedback on oxlint
and type-aware linting, and are excited to see how it helps improve your development workflow.
Connect with us:
oxlint
bugs to oxc and type-aware linting bugs to tsgolint.CallToAction.vue