Skip to content

Commit ecd7e13

Browse files
authored
Update post
Signed-off-by: Cam McHenry <[email protected]>
1 parent fea8db6 commit ecd7e13

File tree

1 file changed

+51
-23
lines changed

1 file changed

+51
-23
lines changed

src/blog/2025-12-01-type-aware-alpha.md

Lines changed: 51 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ We're excited to announce the alpha release of type-aware linting in Oxlint!
1616

1717
Following our [technical preview in August](/blog/2025-08-17-oxlint-type-aware), we're excited to announce that type-aware linting has reached alpha status. This milestone brings significant improvements in stability, configurability, and rule coverage.
1818

19-
Type-aware linting enables powerful rules like `no-floating-promises`, `no-misused-promises`, and `await-thenable` that catch bugs by understanding TypeScript's type system. With N type-aware rules now available, you can catch entire categories of runtime errors before they happen.
19+
Type-aware linting enables powerful rules like `no-floating-promises`, `no-misused-promises`, and `await-thenable` that catch bugs by utilizing TypeScript's type system. With 43 type-aware rules now available, you can catch entire categories of runtime errors before they happen.
2020

2121
The alpha release addresses the major limitations from the technical preview:
2222

2323
- **Full rule configuration support** - Configure individual type-aware rules in `.oxlintrc.json`
2424
- **Disable comment support** - Use `eslint-disable` comments to control type-aware rules
2525
- **IDE support** - Type-aware linting works in VSCode and other supported editors
2626
- **Improved stability** - Many crashes and edge cases have been fixed
27+
- **Better performance** - Less memory used and slightly better rule performance in some cases
2728

2829
While we're still working on performance for very large monorepos and some advanced rules, the alpha is ready for testing in production codebases.
2930

@@ -55,16 +56,44 @@ bunx oxlint --type-aware
5556

5657
:::
5758

58-
To try a specific type-aware rule without other configuration:
59+
To try a specific type-aware rule without other configuration (`tsgolint` must be installed globally or locally already):
5960

60-
```bash
61+
::: code-group
62+
63+
```sh [npm]
6164
npx oxlint --type-aware -A all -D typescript/no-floating-promises
6265
```
6366

67+
```sh [pnpm]
68+
pnpx oxlint --type-aware -A all -D typescript/no-floating-promises
69+
```
70+
71+
```sh [bun]
72+
bunx oxlint --type-aware -A all -D typescript/no-floating-promises
73+
```
74+
75+
:::
76+
6477
For more configuration options, see our [usage guide](/docs/guide/usage/linter/type-aware).
6578

6679
## What's New
6780

81+
### Support for type-checking while linting
82+
83+
`tsgolint` now supports emitting type checking errors from TypeScript while linting. Since type-aware rules already require checking all of the types within a file, we are able to use this existing type information rather than discarding it. This means that in some cases, it is possible to skip doing a separate type-check command altogether (e.g., `tsc --noEmit`), reducing total time spent doing linting and type-checking in CI.
84+
85+
This is an experimental feature, but you can enable it by adding the `--type-check` and `--type-aware` flag to the `oxlint` command:
86+
87+
```
88+
$ oxlint --type-aware --type-check
89+
90+
× typescript(TS2322): Type 'number' is not assignable to type 'string'.
91+
╭─[index.ts:1:7]
92+
1 │ const message: string = 1
93+
· ───────
94+
╰────
95+
```
96+
6897
### Rule configuration support in `oxlint`
6998

7099
Type-aware rules that run in `tsgolint` can be configured in `oxlint` just like any other lint rule. For example, you can configure the `no-floating-promises` rule to allow certain safe calls or ignore `void`:
@@ -83,7 +112,9 @@ Type-aware rules that run in `tsgolint` can be configured in `oxlint` just like
83112
}
84113
```
85114

86-
Previously, this would silently fail, but now the configuration is actually passed to `tsgolint` and parsed for the lint rule to use.
115+
The configuration options are aligned with what `typescript-eslint` supports and documentation can be found in the configuration section for each rule (like [`no-floating-promises`](https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-floating-promises.html#configuration)).
116+
117+
Previously, configuring this rule would silently fail, but now the configuration is actually passed to `tsgolint` and parsed for the lint rule to use.
87118

88119
### Disable comment support in `oxlint`
89120

@@ -96,36 +127,33 @@ Rules that run in `tsgolint` can now be disabled similar to any other `oxlint` r
96127
[1, 2, 3].map(async x => x + 1);
97128
```
98129

99-
Previously, this didn't actually disable the rule, but now it will.
130+
Previously, this didn't actually disable the rule, but now it will work as expected.
100131

101132
### More supported rules
102133

103-
The alpha milestone is largely focused on stability and integrating `tsgolint` more closely with `oxlint`, but we've still ported several rules from `typescript-eslint` which you can now use via `oxlint` as well:
134+
We've continued to make progress on porting popular rules from `typescript-eslint` which you can now use via `oxlint`. `tsgolint`, combined with `oxlint`, currently supports 43 type-aware rules.
135+
136+
Since the initial preview, support for the following rules has also been added:
104137

105-
- `no-deprecated`
138+
- `no-deprecated` (one of the most commonly requested rules)
106139
- `prefer-includes`
107140
- `strict-boolean-expressions`
108141

109142
### TypeScript program diagnostics are now reported
110143

111-
Previously, if TypeScript failed to create and parse a program, these errors were not reported which lead to confusion around why linting was not working. Now, we report any issues with creating a program as a diagnostic. For example, if a `tsconfig.json` file contains `baseUrl`, that will be reported now:
144+
Previously, if TypeScript failed to create and parse a program, these errors were not reported which lead to confusion around why linting was not working. Now, we report any issues with creating a program as a diagnostic, including if there is a configuration issue in the `tsconfig.json` file.
145+
146+
For example, if a `tsconfig.json` file contains `baseUrl`, that will be reported as an error, since `baseUrl` has been removed from TypeScript:
112147

113148
```
114149
$ oxlint --type-aware
115150
116-
× Invalid tsconfig
117-
╭─[docs/tsconfig.json:1:1]
118-
1 │ {
119-
· ▲
120-
2 │ "compilerOptions": {
121-
╰────
122-
help: Non-relative paths are not allowed. Did you forget a leading './'?
123-
124-
× Invalid tsconfig
125-
╭─[test/ui/tsconfig.json:1:1]
126-
1 │ {
127-
· ▲
128-
2 │ "extends": "../../tsconfig.base.json",
151+
× typescript(tsconfig-error): Invalid tsconfig
152+
╭─[tsconfig.json:4:3]
153+
3 │ "compilerOptions": {
154+
4 │ "baseUrl": ".",
155+
· ─────────
156+
5 │ "experimentalDecorators": true,
129157
╰────
130158
help: Option 'baseUrl' has been removed. Please remove it from your configuration.
131159
See https://github.com/oxc-project/tsgolint/issues/351 for more information.
@@ -148,7 +176,7 @@ oxlint CLI (Rust)
148176
└─ Formats and displays results
149177
150178
tsgolint (Go)
151-
├─ Uses typescript-go for type checking
179+
├─ Uses typescript-go directly for type checking
152180
├─ Executes type-aware rules
153181
└─ Returns structured diagnostics
154182
```
@@ -157,7 +185,7 @@ This design keeps Oxlint's core fast while leveraging TypeScript's type system t
157185

158186
### TypeScript Compatibility
159187

160-
`tsgolint` is based on [typescript-go](https://github.com/microsoft/typescript-go), Microsoft's TypeScript v7.0 rewrite in Go, not the original TypeScript compiler.
188+
`tsgolint` is based on [typescript-go](https://github.com/microsoft/typescript-go), Microsoft's TypeScript v7.0 rewrite in Go, not the original TypeScript compiler. This means that you encounter some features which are no longer supported.
161189

162190
**Important compatibility notes:**
163191

0 commit comments

Comments
 (0)