✨ Add oxlint-tsgolint for type-aware linting

Activates type-aware rules via oxlint --type-aware, backed by
oxlint-tsgolint (TypeScript-Go). Catches unsafe type assertions,
unnecessary type parameters, and other issues regular oxlint
cannot see.

- Add oxlint-tsgolint devDep + 6 platform-specific native bindings
  as optionalDependencies (same pattern as oxlint)
- Add --type-aware flag to check:oxlint
- Add 6 @oxlint-tsgolint/* platforms to check:outdated ignore list
- Disable 3 type-aware rules in .oxlintrc.json with rationale:
  - typescript/no-unsafe-type-assertion, typescript/no-unnecessary-type-parameters:
    fire on legitimate generic type machinery in keysMatch/MatchBuilder
    that needs type-system restructuring (deferred to a follow-up)
  - typescript/no-floating-promises in test files: expectTypeOf() is
    a sync type-assertion library that oxlint-tsgolint misidentifies

Code simplifications enabled by the new strict checks:
- src/match.ts: drop value as unknown casts (T is already assignable
  to unknown) and the redundant run(value) as R cast
- src/index.test.ts: drop unnecessary 'X' as 'X | Y' assertions in
  match<...>(...) calls (literals are already assignable to the union)

Documentation updates in project-specs.md and README.md. Add
'tsgolint' to cspell word list.
This commit is contained in:
tmu committed 2026-09-04 23:20:02 +02:00
1 parent ec98223f8d
commit 2b3ef0f721
8 files changed
+148 -25

No files matched your search

+6 -7
View File
@@ -20,13 +20,11 @@
"eslint/sort-imports": "off",
"import/consistent-type-specifier-style": "off",
"unicorn/prefer-export-from": "off",
"typescript/method-signature-style": "off"
},
"env": {
"builtin": true,
"es2024": true,
"node": true
"typescript/method-signature-style": "off",
"typescript/no-unsafe-type-assertion": "off",
"typescript/no-unnecessary-type-parameters": "off"
},
"env": { "builtin": true, "es2024": true, "node": true },
"overrides": [
{
"files": ["**/*.test.ts"],
@@ -34,7 +32,8 @@
"no-unused-expressions": "off",
"no-empty-file": "off",
"import/no-nodejs-modules": "off",
"eslint/no-magic-numbers": "off"
"eslint/no-magic-numbers": "off",
"typescript/no-floating-promises": "off"
}
}
],