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
See ARCHITECTURE.md for detailed architectural documentation.
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
For troubleshooting and development purposes, tsgolint supports debug logging through the OXC_LOG
environment variable.
To enable verbose debug output, set the OXC_LOG
environment variable to debug
:
OXC_LOG=debug tsgolint
Debug logging provides detailed information about the linting process, including:
- File assignment to TypeScript programs
- Worker distribution and execution
- Performance timing information
- Internal state details
This can be helpful when:
- Diagnosing performance issues
- Understanding how files are being processed
- Troubleshooting TypeScript configuration problems
- Contributing to tsgolint development
tsgolint includes several types of tests to ensure correctness:
Run Go unit tests for individual rules:
go test ./internal/...
./test.sh
- End-to-end snapshot test running all 40+ rules- Runs all tsgolint rules on all fixture files
- Captures diagnostic output in deterministic, sortable format
- Verifies output matches expected snapshot