Skip to content

Commit a253976

Browse files
camchenrycamc314
authored andcommitted
Add features
Added new features and capabilities for rule configuration and diagnostics in oxlint. Signed-off-by: Cam McHenry <camchenry@users.noreply.github.com>
1 parent 645fea1 commit a253976

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

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

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,70 @@ For more configuration options, see our [usage guide](/docs/guide/usage/linter/t
6565

6666
## What's New
6767

68-
[Add details about new features and capabilities]
68+
### Rule configuration support in `oxlint`
69+
70+
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`:
71+
72+
```json
73+
{
74+
"rules": {
75+
"typescript/no-floating-promises": ["error", {
76+
"ignoreVoid": true,
77+
"allowForKnownSafePromises": [
78+
{ "from": "file", "name": "SafePromise" },
79+
{ "from": "lib", "name": "PromiseLike" },
80+
]
81+
}]
82+
}
83+
}
84+
```
85+
86+
Previously, this would silently fail, but now the configuration is actually passed to `tsgolint` and parsed for the lint rule to use.
87+
88+
### Disable comment support in `oxlint`
89+
90+
Rules that run in `tsgolint` can now be disabled similar to any other `oxlint` rule by placing a comment in the file or on a line:
91+
92+
```js
93+
// oxlint-disable-next-line typescript/no-floating-promises
94+
95+
/* oxlint-disable-file typescript/no-floating-promises
96+
```
97+
98+
Previously, this didn't actually disable the rule, but now it will.
99+
100+
### More supported rules
101+
102+
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:
103+
104+
- `no-deprecated`
105+
- `prefer-includes`
106+
- `strict-boolean-expressions`
107+
108+
### TypeScript program diagnostics are now reported
109+
110+
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:
111+
112+
```
113+
$ oxlint --type-aware
114+
115+
× Invalid tsconfig
116+
╭─[docs/tsconfig.json:1:1]
117+
1 │ {
118+
· ▲
119+
2 │ "compilerOptions": {
120+
╰────
121+
help: Non-relative paths are not allowed. Did you forget a leading './'?
122+
123+
× Invalid tsconfig
124+
╭─[test/ui/tsconfig.json:1:1]
125+
1 │ {
126+
· ▲
127+
2 │ "extends": "../../tsconfig.base.json",
128+
╰────
129+
help: Option 'baseUrl' has been removed. Please remove it from your configuration.
130+
See https://github.com/oxc-project/tsgolint/issues/351 for more information.
131+
```
69132
70133
## Performance
71134

0 commit comments

Comments
 (0)