Skip to content

Type-Aware Linting

Read our technical preview announcement for background details, and the rationale for the architecture we have chosen for type-aware linting.

Installation

sh
npm add -D oxlint-tsgolint@latest
sh
pnpm add -D oxlint-tsgolint@latest
sh
yarn add -D oxlint-tsgolint@latest
sh
bun add -D oxlint-tsgolint@latest

Run oxlint with --type-aware

bash
oxlint --type-aware

Unimplemented Rules

See https://github.com/oxc-project/tsgolint/issues/104

Supported Rules

List of supported rules:

TypeScript Compatibility

tsgolint is based on typescript-go (Microsoft's TypeScript v7.0 rewrite in Go), not the original TypeScript compiler written in TypeScript.

Key implications:

  • Only TypeScript 7.0+ features are supported
  • Pre-7.0 syntax and features (like baseUrl in tsconfig.json) are not supported
  • If you're using deprecated features that were deprecated in TypeScript 6.0 or removed in TypeScript 7.0, you'll need to migrate your codebase first

For help migrating deprecated tsconfig options, see the TypeScript migration guide.

Architecture

Type-aware linting in Oxlint uses a unique two-binary architecture:

oxlint CLI (Rust)
  ├─ Handles file traversal, ignore logic, and diagnostics
  ├─ Runs non-type-aware rules and custom JS plugins
  ├─ Passes paths and configuration to tsgolint
  └─ Formats and displays results

tsgolint (Go)
  ├─ Uses typescript-go directly for type checking
  ├─ Executes type-aware rules
  └─ Returns structured diagnostics

This design keeps Oxlint's core fast while leveraging TypeScript's type system through typescript-go. The frontend-backend separation means oxlint controls the user experience while tsgolint handles the heavy lifting of type analysis.

Released under the MIT License.