Skip to content

Commit e50f913

Browse files
authored
docs: add minimal type-aware linting guide (#489)
1 parent 2109164 commit e50f913

File tree

4 files changed

+88
-2
lines changed

4 files changed

+88
-2
lines changed

.vitepress/config/en.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export const enConfig = defineLocaleConfig("root", {
4848
text: "Configuring Oxlint",
4949
link: "/docs/guide/usage/linter/config",
5050
},
51+
{
52+
text: "Type-Aware Linting",
53+
link: "/docs/guide/usage/linter/type-aware",
54+
},
5155
{
5256
text: "Nested Configs",
5357
link: "/docs/guide/usage/linter/nested-config",

src/docs/guide/usage/linter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ and run Oxlint before ESLint in your local or CI setup for a quicker feedback lo
2828
`eslint-plugin-jest`, `eslint-plugin-unicorn`, `eslint-plugin-jsx-a11y` and
2929
[many more](https://github.com/oxc-project/oxc/issues/481).
3030
- Supports
31-
- [type-aware rules](https://oxc.rs/blog/2025-08-17-oxlint-type-aware.html).
31+
- [type-aware rules](./linter/type-aware).
3232
- [`.oxlintrc.json` configuration file](./linter/config).
3333
- [Nested configuration file](./linter/nested-config)
3434
- [Comment disabling](./linter/config.html#configuring-rules-via-inline-configuration-comments).
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Type-Aware Linting
2+
3+
Read our [technical preview announcement](/blog/2025-08-17-oxlint-type-aware) for technical decision and background details.
4+
5+
## Installation
6+
7+
```bash
8+
pnpm add -D oxlint-tsgolint@latest
9+
```
10+
11+
Run `oxlint` with `--type-aware`
12+
13+
```bash
14+
oxlint --type-aware
15+
```
16+
17+
## Unsupported Features
18+
19+
The current version runs the default behavior and does nothing else.
20+
21+
The following issues will be addressed for the alpha version.
22+
23+
- [Allow configuring rules](https://github.com/oxc-project/tsgolint/issues/51)
24+
- [Disable comments are not respected](https://github.com/oxc-project/oxc/issues/13491)
25+
- [Type Checker is not enabled](https://github.com/oxc-project/tsgolint/issues/106)
26+
- [IDE support](https://github.com/oxc-project/tsgolint/issues/71)
27+
28+
## Unimplemented Rules
29+
30+
See https://github.com/oxc-project/tsgolint/issues/104
31+
32+
## Configuration
33+
34+
List of supported rules:
35+
36+
```json
37+
{
38+
"$schema": "./node_modules/oxlint/configuration_schema.json",
39+
"rules": {
40+
"typescript/await-thenable": "error",
41+
"typescript/no-array-delete": "error",
42+
"typescript/no-base-to-string": "error",
43+
"typescript/no-confusing-void-expression": "error",
44+
"typescript/no-duplicate-type-constituents": "error",
45+
"typescript/no-floating-promises": "error",
46+
"typescript/no-for-in-array": "error",
47+
"typescript/no-implied-eval": "error",
48+
"typescript/no-meaningless-void-operator": "error",
49+
"typescript/no-misused-promises": "error",
50+
"typescript/no-misused-spread": "error",
51+
"typescript/no-mixed-enums": "error",
52+
"typescript/no-redundant-type-constituents": "error",
53+
"typescript/no-unnecessary-boolean-literal-compare": "error",
54+
"typescript/no-unnecessary-template-expression": "error",
55+
"typescript/no-unnecessary-type-arguments": "error",
56+
"typescript/no-unnecessary-type-assertion": "error",
57+
"typescript/no-unsafe-argument": "error",
58+
"typescript/no-unsafe-assignment": "error",
59+
"typescript/no-unsafe-call": "error",
60+
"typescript/no-unsafe-enum-comparison": "error",
61+
"typescript/no-unsafe-member-access": "error",
62+
"typescript/no-unsafe-return": "error",
63+
"typescript/no-unsafe-type-assertion": "error",
64+
"typescript/no-unsafe-unary-minus": "error",
65+
"typescript/non-nullable-type-assertion-style": "error",
66+
"typescript/only-throw-error": "error",
67+
"typescript/prefer-promise-reject-errors": "error",
68+
"typescript/prefer-reduce-type-parameter": "error",
69+
"typescript/prefer-return-this-type": "error",
70+
"typescript/promise-function-async": "error",
71+
"typescript/related-getter-setter-pairs": "error",
72+
"typescript/require-array-sort-compare": "error",
73+
"typescript/require-await": "error",
74+
"typescript/restrict-plus-operands": "error",
75+
"typescript/restrict-template-expressions": "error",
76+
"typescript/return-await": "error",
77+
"typescript/switch-exhaustiveness-check": "error",
78+
"typescript/unbound-method": "error",
79+
"typescript/use-unknown-in-catch-callback-variable": "error"
80+
}
81+
}
82+
```

src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ features:
2020
link: /docs/guide/usage/parser
2121
linkText: Usage guide
2222
- title: Linter ✅
23-
details: 50~100x faster than ESLint<br/>570+ rules and growing
23+
details: 50~100x faster than ESLint<br/>570+ rules and growing<br/>Type-aware Linting
2424
link: /docs/guide/usage/linter
2525
linkText: Usage guide
2626
- title: Resolver ✅

0 commit comments

Comments
 (0)