diff --git a/.vitepress/config/en.ts b/.vitepress/config/en.ts index 10edaf6016f..cfe7be1e8b9 100644 --- a/.vitepress/config/en.ts +++ b/.vitepress/config/en.ts @@ -48,6 +48,10 @@ export const enConfig = defineLocaleConfig("root", { text: "Configuring Oxlint", link: "/docs/guide/usage/linter/config", }, + { + text: "Type-Aware Linting", + link: "/docs/guide/usage/linter/type-aware", + }, { text: "Nested Configs", link: "/docs/guide/usage/linter/nested-config", diff --git a/src/docs/guide/usage/linter.md b/src/docs/guide/usage/linter.md index ec7e828b553..66ca232fe38 100644 --- a/src/docs/guide/usage/linter.md +++ b/src/docs/guide/usage/linter.md @@ -28,7 +28,7 @@ and run Oxlint before ESLint in your local or CI setup for a quicker feedback lo `eslint-plugin-jest`, `eslint-plugin-unicorn`, `eslint-plugin-jsx-a11y` and [many more](https://github.com/oxc-project/oxc/issues/481). - Supports - - [type-aware rules](https://oxc.rs/blog/2025-08-17-oxlint-type-aware.html). + - [type-aware rules](./linter/type-aware). - [`.oxlintrc.json` configuration file](./linter/config). - [Nested configuration file](./linter/nested-config) - [Comment disabling](./linter/config.html#configuring-rules-via-inline-configuration-comments). diff --git a/src/docs/guide/usage/linter/type-aware.md b/src/docs/guide/usage/linter/type-aware.md new file mode 100644 index 00000000000..a4c3fead807 --- /dev/null +++ b/src/docs/guide/usage/linter/type-aware.md @@ -0,0 +1,82 @@ +# Type-Aware Linting + +Read our [technical preview announcement](/blog/2025-08-17-oxlint-type-aware) for technical decision and background details. + +## Installation + +```bash +pnpm add -D oxlint-tsgolint@latest +``` + +Run `oxlint` with `--type-aware` + +```bash +oxlint --type-aware +``` + +## Unsupported Features + +The current version runs the default behavior and does nothing else. + +The following issues will be addressed for the alpha version. + +- [Allow configuring rules](https://github.com/oxc-project/tsgolint/issues/51) +- [Disable comments are not respected](https://github.com/oxc-project/oxc/issues/13491) +- [Type Checker is not enabled](https://github.com/oxc-project/tsgolint/issues/106) +- [IDE support](https://github.com/oxc-project/tsgolint/issues/71) + +## Unimplemented Rules + +See https://github.com/oxc-project/tsgolint/issues/104 + +## Configuration + +List of supported rules: + +```json +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "rules": { + "typescript/await-thenable": "error", + "typescript/no-array-delete": "error", + "typescript/no-base-to-string": "error", + "typescript/no-confusing-void-expression": "error", + "typescript/no-duplicate-type-constituents": "error", + "typescript/no-floating-promises": "error", + "typescript/no-for-in-array": "error", + "typescript/no-implied-eval": "error", + "typescript/no-meaningless-void-operator": "error", + "typescript/no-misused-promises": "error", + "typescript/no-misused-spread": "error", + "typescript/no-mixed-enums": "error", + "typescript/no-redundant-type-constituents": "error", + "typescript/no-unnecessary-boolean-literal-compare": "error", + "typescript/no-unnecessary-template-expression": "error", + "typescript/no-unnecessary-type-arguments": "error", + "typescript/no-unnecessary-type-assertion": "error", + "typescript/no-unsafe-argument": "error", + "typescript/no-unsafe-assignment": "error", + "typescript/no-unsafe-call": "error", + "typescript/no-unsafe-enum-comparison": "error", + "typescript/no-unsafe-member-access": "error", + "typescript/no-unsafe-return": "error", + "typescript/no-unsafe-type-assertion": "error", + "typescript/no-unsafe-unary-minus": "error", + "typescript/non-nullable-type-assertion-style": "error", + "typescript/only-throw-error": "error", + "typescript/prefer-promise-reject-errors": "error", + "typescript/prefer-reduce-type-parameter": "error", + "typescript/prefer-return-this-type": "error", + "typescript/promise-function-async": "error", + "typescript/related-getter-setter-pairs": "error", + "typescript/require-array-sort-compare": "error", + "typescript/require-await": "error", + "typescript/restrict-plus-operands": "error", + "typescript/restrict-template-expressions": "error", + "typescript/return-await": "error", + "typescript/switch-exhaustiveness-check": "error", + "typescript/unbound-method": "error", + "typescript/use-unknown-in-catch-callback-variable": "error" + } +} +``` diff --git a/src/index.md b/src/index.md index 2282dd3d759..9f7a78a8e97 100644 --- a/src/index.md +++ b/src/index.md @@ -20,7 +20,7 @@ features: link: /docs/guide/usage/parser linkText: Usage guide - title: Linter ✅ - details: 50~100x faster than ESLint
570+ rules and growing + details: 50~100x faster than ESLint
570+ rules and growing
Type-aware Linting link: /docs/guide/usage/linter linkText: Usage guide - title: Resolver ✅