Skip to content

Type-Aware Linting

Type-aware linting enables rules that rely on TypeScript’s type system, such as detecting unhandled promises or unsafe assignments. In Oxlint, type-aware linting is provided by tsgolint and is integrated into the Oxlint CLI and configuration system.

Type-aware linting currently supports 59 out of 61 type-aware rules from typescript-eslint. Rule coverage, performance, and compatibility continue to improve.

Overview

Oxlint separates responsibilities between two components:

  • Oxlint (Rust) Handles file traversal, ignore logic, configuration, non-type-aware rules, and reporting.

  • tsgolint (Go) Builds TypeScript programs using typescript-go and executes type-aware rules, returning structured diagnostics to Oxlint.

Installation

Type-aware linting requires an additional dependency:

sh
npm add -D oxlint-tsgolint@latest
``````sh [pnpm]
pnpm add -D oxlint-tsgolint@latest
``````sh [yarn]
yarn add -D oxlint-tsgolint@latest
``````sh [bun]
bun add -D oxlint-tsgolint@latest
``````bash
oxlint --type-aware
``````json [.oxlintrc.json]
{
  "options": {
    "typeAware": true
  }
}
``````ts [oxlint.config.ts]
import { defineConfig } from "oxlint";

export default defineConfig({
  options: {
    typeAware: true,
  },
});
``````bash
pnpm install
pnpm -r build
oxlint --type-aware
``````bash
oxlint --type-aware --type-check
``````json [.oxlintrc.json]
{
  "options": {
    "typeAware": true,
    "typeCheck": true
  }
}
``````ts [oxlint.config.ts]
import { defineConfig } from "oxlint";

export default defineConfig({
  options: {
    typeAware: true,
    typeCheck: true,
  },
});
``````bash
# before
tsc --noEmit
oxlint

# after
oxlint --type-aware --type-check
``````json [.oxlintrc.json]
{
  "plugins": ["typescript"],
  "rules": {
    "typescript/no-floating-promises": "error",
    "typescript/no-unsafe-assignment": "warn"
  }
}
``````ts [oxlint.config.ts]
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["typescript"],
  rules: {
    "typescript/no-floating-promises": "error",
    "typescript/no-unsafe-assignment": "warn",
  },
});
``````json [.oxlintrc.json]
{
  "plugins": ["typescript"],
  "rules": {
    "typescript/no-floating-promises": ["error", { "ignoreVoid": true }]
  }
}
``````ts [oxlint.config.ts]
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["typescript"],
  rules: {
    "typescript/no-floating-promises": ["error", { ignoreVoid: true }],
  },
});
``````ts
// oxlint-disable-next-line typescript/no-floating-promises
doSomethingAsync();
``````bash
oxlint --type-aware --report-unused-disable-directives
``````bash
OXC_LOG=debug oxlint --type-aware

2026/01/01 12:00:00.000000 Starting tsgolint 2026/01/01 12:00:00.001000 Starting to assign files to programs. Total files: 259 2026/01/01 12:00:01.000000 Done assigning files to programs. Total programs: 8. Unmatched files: 75 2026/01/01 12:00:01.001000 Starting linter with 12 workers 2026/01/01 12:00:01.001000 Workload distribution: 8 programs 2026/01/01 12:00:01.002000 [1/8] Running linter on program: /path/to/project/jsconfig.json ... 2026/01/01 12:00:01.100000 [4/8] Running linter on program: /path/to/project/tsconfig.json 2026/01/01 12:00:02.500000 Program created with 26140 source files 2026/01/01 12:00:14.000000 /path/to/project/oxlint-plugin.mts ... 2026/01/01 12:00:14.100000 [5/8] Running linter on program: /path/to/project/apps/tsconfig.json ... 2026/01/01 12:00:15.000000 Linting Complete Finished in 16.4s on 259 files with 161 rules using 12 threads.

json
{
  "include": ["**/*"] // ❌ Catches everything
}
``````json [tsconfig.json]
{
  "include": ["src/**/*"], // ✅ Only source files
  "exclude": ["dist", "build", "coverage"] // node_modules are excluded by default
}
``````json [tsconfig.json]
{
  "files": []
}

2026/01/01 12:00:02.500000 Program created with 26140 source files