Type-Aware Linting Stable | The JavaScript Oxidation Compiler
Announcing Type-Aware Linting Stable
Skip to content
Search⌘CtrlK
Appearance
MenuReturn to top
Today we're releasing tsgolint v7, the type-aware linting engine behind Oxlint.<br>This release tracks TypeScript v7.0.2 and brings tsgolint to 59 of typescript-eslint's 61 type-aware rules. Since our alpha release, we have added 16 rules, per-rule timings, improved configuration, and another round of performance work.<br>Getting started <br>Install the latest Oxlint and tsgolint, then enable type-aware linting:<br>shpnpm add -D oxlint oxlint-tsgolint@7<br>pnpm oxlint --type-aware<br>To report TypeScript compiler errors alongside lint diagnostics, add --type-check:<br>shpnpm oxlint --type-aware --type-check<br>Linting and type-checking then share the same TypeScript program, avoiding the duplicate setup and analysis required by a separate type-check command.<br>Versioning <br>tsgolint is built directly on TypeScript v7, hence its compatibility is tied to a specific TypeScript release. The new versioning scheme for tsgolint reflects that:<br>textv7.0.2000<br>^^^^^^ TypeScript version<br>^^^ tsgolint patch version<br>In other words, v7.0.2000 is tsgolint patch 0 for TypeScript v7.0.2. If we need to ship another tsgolint fix while staying on that TypeScript version, the next release will be v7.0.2001. When we update TypeScript, the TypeScript portion changes and the tsgolint patch resets.<br>16 new rules since alpha <br>The alpha shipped with 43 type-aware rules. v7.0.2000 ships 59 of 61, adding:<br>consistent-return<br>consistent-type-exports<br>dot-notation<br>no-unnecessary-condition<br>no-unnecessary-qualifier<br>no-unnecessary-type-conversion<br>no-unnecessary-type-parameters<br>no-useless-default-assignment<br>prefer-find<br>prefer-nullish-coalescing<br>prefer-optional-chain<br>prefer-readonly<br>prefer-readonly-parameter-types<br>prefer-regexp-exec<br>prefer-string-starts-ends-with<br>strict-void-return<br>Configuration as code <br>Type-aware linting no longer needs to be wired into every package script or CI command. You can enable it alongside the rest of your lint configuration:<br>oxlint.config.ts.oxlintrc.json<br>tsimport { defineConfig } from "oxlint";
export default defineConfig({<br>options: {<br>typeAware: true,<br>typeCheck: true,<br>},<br>});<br>json{<br>"options": {<br>"typeAware": true,<br>"typeCheck": true
typeAware enables rules that require type information. The typeCheck option additionally reports TypeScript compiler diagnostics; omit it if you only want type-aware linting. Both options are root-only, and CLI flags take precedence.<br>See the type-aware linting guide for configuration and migration details.<br>See where lint time goes <br>Thanks to Cam McHenry, Oxlint can now report timings for every enabled rule, including type-aware rules:<br>shpnpm oxlint --type-aware --debug timings<br>The slowest rules are listed first:<br>textRule timings:<br>Rule Time (ms) Relative Calls Source<br>typescript/unbound-method 108.620 46.5% 12450 type-aware<br>typescript/no-floating-promises 65.606 28.1% 7327 type-aware<br>eslint/no-unused-vars 2.187 0.9% 372 native<br>typescript/no-duplicate-type-constituents 1.505 0.6% 870 type-aware<br>typescript/no-meaningless-void-operator 1.445 0.6% 383 type-aware<br>vitest/no-standalone-expect 0.978 0.4% 372 native<br>vitest/expect-expect 0.951 0.4% 4682 native<br>typescript/no-implied-eval 0.401 0.2% 13809 type-aware<br>oxc/no-map-spread 0.383 0.2% 12545 native<br>react/no-did-update-set-state 0.382 0.2% 12545 native<br>eslint/no-misleading-character-class 0.380 0.2% 13524 native<br>typescript/no-redundant-type-constituents 0.371 0.2% 870 type-aware<br>unicorn/no-single-promise-in-promise-methods 0.362 0.2% 12545 native<br>eslint/no-useless-backreference 0.360 0.2% 13524 native<br>typescript/no-useless-default-assignment 0.258 0.1% 3110 type-aware<br>eslint/no-console 0.256 0.1% 12484 native<br>eslint/no-caller 0.253 0.1% 11603 native<br>...<br>The report shows each rule's total time, relative share, call count, and whether it ran natively in Oxlint or through the type-aware engine. This makes expensive rules and configuration changes much easier to investigate, with no overhead when timings are not enabled. See our profiling thread on X for examples of how timings helped us identify and speed up expensive rules.<br>Faster again <br>In our latest benchmark run, tsgolint was 12 to 18 times faster than ESLint with typescript-eslint across four large TypeScript codebases:<br>RepositoryESLint + typescript-eslinttsgolintSpeedupmicrosoft/vscode83.2s6.96s12xmicrosoft/typescript27.2s1.94s14xtypeorm/typeorm13.2s0.75s18xvuejs/core12.3s0.95s13xThese results were measured on an Apple M4 Pro with 12 cores. Both linters used the same TypeScript 7-compatible project configurations; see the benchmark suite for the full methodology and results.<br>Since the alpha, we have made tsconfig discovery concurrent, cached filesystem reads, batched semantic diagnostics, and reused per-file rule state. We have also added targeted fast paths that avoid expensive type-checker queries when syntax already gives us the answer. For example,...