Type-Aware Linting ​
Read our technical preview announcement for technical decision and background details.
Installation ​
sh
npm add -D oxlint-tsgolint@latestsh
pnpm add -D oxlint-tsgolint@latestsh
yarn add -D oxlint-tsgolint@latestsh
bun add -D oxlint-tsgolint@latestRun oxlint with --type-aware
bash
oxlint --type-awareUnsupported 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
- Disable comments are not respected
- Type Checker is not enabled
- IDE support
- Auto-fixes for type-aware rules only work in the VSCode extension, not in the CLI (
oxlint --fix)
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"
}
}TypeScript Compatibility ​
TSGolint is based on typescript-go (Microsoft's TypeScript v7.0 rewrite in Go), not the original TypeScript compiler written in TypeScript.
Key implications:
- Only TypeScript 7.0+ features are supported
- Pre-7.0 syntax and features (like
baseUrlin tsconfig.json) are not supported - If you're using deprecated features that were deprecated in TypeScript 6.0 or removed in TypeScript 7.0, you'll need to migrate your codebase first
For help migrating deprecated tsconfig options, see the TypeScript migration guide.