tsgolint is a TypeScript linter containing only type-aware rules, powered by typescript-go adapted for Oxlint.
This project originated in typescript-eslint/tsgolint. Fork permission is granted by @auvred.
If you want faster typed linting with ESLint, see typescript-eslint/typescript-eslint#10940 Enhancement: Use TypeScript's Go port (tsgo / typescript-go) for type information.
Important
tsgolint is a prototype in the early stages of development. This is a community effort. Feel free to ask to be assigned to any of the good first issues.
- Primitive linter engine
- Lint rules tester
- Source code fixer
- 40 type-aware typescript-eslint's rules
- Basic
tsgolint
CLI
Try running
npx oxlint-tsgolint --help
to see available options.
tsgolint is 20-40 times faster than ESLint + typescript-eslint.
Most of the speedup is due to the following facts:
- Native speed parsing and type-checking (thanks to typescript-go)
- No more TS AST -> ESTree AST conversions. TS AST is directly used in rules.
- Parallel parsing, type checking and linting. tsgolint uses all available CPU cores.
See benchmarks for more info.
- Non-type-aware rules
- Editor extension
- Rich CLI features
- Config file
- Plugin system
Oxlint CLI -> paths + rules -> tsgolint -> diagnostics -> Oxlint CLI.
- Oxlint is the "frontend" for tsgolint, it handles CLI, path walking, ignores logic and printing of diagnostics.
- tsgolint is the backend for Oxlint, accepting paths as input, and outputs structured diagnostics.
Scope of tsgolint is only:
- run the type-aware rules
- pass structured diagnostics back to oxlint
tsgolint accesses internal typescript-go APIs via shims, which is not a recommended approach. We advise against using this method and suggest waiting for an official API release instead. See this discussion and this one.
More technical details can be found here.
git submodule update --init # init typescript-go submodule
cd typescript-go
git am --3way --no-gpg-sign ../patches/*.patch # apply typescript-go patches
cd ..
go build -o tsgolint ./cmd/tsgolint