You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): add --type-aware and --type-check flags for oxlint (#493)
* feat(cli): add --type-aware and --type-check flags for oxlint
Adds proper CLI support for oxlint's type-aware linting features:
- --type-aware: enables lint rules requiring type info
- --type-check: enables TypeScript compiler diagnostics
Both flags work with `check` and `fix` commands when using oxlint.
* feat(init): add --type-aware flag for oxlint
installs oxlint-tsgolint when --linter oxlint --type-aware
* Create three-jars-report.md
---------
Co-authored-by: Hayden Bleasel <[email protected]>
Copy file name to clipboardExpand all lines: apps/docs/content/docs/usage.mdx
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,44 @@ You can also apply unsafe fixes (fixes that may change code behavior):
55
55
npx ultracite fix --unsafe
56
56
```
57
57
58
+
### Type-Aware Linting (Oxlint)
59
+
60
+
When using Oxlint, you can enable type-aware linting rules that leverage TypeScript's type system.
61
+
62
+
To set up type-aware linting during initialization:
63
+
64
+
```bash title="Terminal"
65
+
npx ultracite init --linter oxlint --type-aware
66
+
```
67
+
68
+
This installs the required `oxlint-tsgolint` dependency automatically.
69
+
70
+
Then use the flags when checking or fixing:
71
+
72
+
```bash title="Terminal"
73
+
npx ultracite check --type-aware
74
+
npx ultracite fix --type-aware
75
+
```
76
+
77
+
This enables rules like `no-floating-promises`, `no-misused-promises`, and `await-thenable` that catch bugs by analyzing types.
78
+
79
+
You can also enable TypeScript compiler diagnostics (experimental):
80
+
81
+
```bash title="Terminal"
82
+
npx ultracite check --type-check
83
+
npx ultracite fix --type-check
84
+
```
85
+
86
+
Both flags can be combined:
87
+
88
+
```bash title="Terminal"
89
+
npx ultracite fix --type-aware --type-check
90
+
```
91
+
92
+
<Callout>
93
+
These flags only apply when using Oxlint. They have no effect with Biome or ESLint.
94
+
</Callout>
95
+
58
96
### Validating Setup
59
97
60
98
The `doctor` command checks your setup for issues and provides recommendations. This is useful to run after installing Ultracite to ensure everything is configured correctly:
0 commit comments