Skip to content

[chore] investigate oxlint's type aware linting #862

@threepointone

Description

@threepointone

Oxlint type-aware linting is very compelling, but I'd recommend not adopting it yet. Here's why:
What it is:
A separate Go binary (oxlint-tsgolint) that uses Microsoft's typescript-go (the Go port of tsc) to provide type information to lint rules
45 of 59 typescript-eslint type-aware rules implemented, including heavy hitters like no-floating-promises, no-misused-promises, await-thenable, no-unsafe-assignment, and switch-exhaustiveness-check
Runs with oxlint --type-aware, opt-in flag
Can also replace tsc --noEmit with oxlint --type-aware --type-check
Why it's appealing for this repo:
Catches real bugs that static analysis alone misses (floating promises, unsafe any propagation)
20-40x faster than ESLint + typescript-eslint — benchmarks show 1-7 seconds on real projects
Could replace the separate typecheck script if --type-check is stable enough
Why to wait:
Alpha status — the docs say it explicitly: "Rule coverage, performance, and compatibility continue to improve"
Requires TypeScript 7.0+ compatibility — your repo uses TypeScript ^5.9.3. The typescript-go backend expects TS 7 tsconfig semantics, and config options deprecated in TS 6 or removed in TS 7 may not work. You'd need to migrate tsconfig files first.
Monorepo complexity — the docs warn that in monorepos, all dependent packages need to be built (.d.ts available) before type-aware linting runs. Your check script would need to run build first.
Memory concerns — "Very large codebases may encounter high memory usage" — your monorepo has ~273 lint-able files across many workspaces, each with their own tsconfig.
Separate binary — oxlint-tsgolint is a Go binary that oxlint spawns as a subprocess. It's a separate install, separate versioning, and an additional CI dependency.
Recommendation: Wait for beta/stable. When TypeScript 7 ships and tsgolint exits alpha, it'll be a straightforward addition — just npm add -D oxlint-tsgolint, add --type-aware to the lint script, and enable the rules you want. The current non-type-aware oxlint setup we just configured is solid for now, and your existing typecheck script via tsc catches type errors separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions