♻️ Move type-aware config to .oxlintrc.json; use source-level disable directives

Cleaner separation of concerns:
- options.typeAware: true in .oxlintrc.json activates type-aware
  rules declaratively (equivalent to --type-aware CLI flag, but
  the script command stays clean: just 'oxlint ...')
- Remove the 3 type-aware rule disables from .oxlintrc.json
- Add source-level oxlint-disable directives instead:
  - 4x typescript/no-unsafe-type-assertion (pattern.ts: keysMatch
    Object.keys() cast, candidate[] cast; structuralMatcher value
    as S cast; match.ts: handler as ... cast in nextCases)
  - 1x typescript/no-unnecessary-type-parameters (pattern.ts:
    keysMatch <S extends object>)
  - 1x file-level typescript/no-floating-promises in index.test.ts
    (expectTypeOf() is a sync type-assertion library that the
    type-aware linter misidentifies)

Disabling rules at the source (next to the line that needs the
exemption) documents intent more clearly than a global config
override, and makes the trade-off visible to anyone reading the
code. Re-enabling a rule in the future only requires removing the
inline comment, not editing a central config.
This commit is contained in:
tmu committed 2026-09-04 23:27:58 +02:00
1 parent 2b3ef0f721
commit 34e9b52ee8
7 files changed
+38 -27

No files matched your search

+3 -5
View File
@@ -20,10 +20,9 @@
"eslint/sort-imports": "off",
"import/consistent-type-specifier-style": "off",
"unicorn/prefer-export-from": "off",
"typescript/method-signature-style": "off",
"typescript/no-unsafe-type-assertion": "off",
"typescript/no-unnecessary-type-parameters": "off"
"typescript/method-signature-style": "off"
},
"options": { "typeAware": true },
"env": { "builtin": true, "es2024": true, "node": true },
"overrides": [
{
@@ -32,8 +31,7 @@
"no-unused-expressions": "off",
"no-empty-file": "off",
"import/no-nodejs-modules": "off",
"eslint/no-magic-numbers": "off",
"typescript/no-floating-promises": "off"
"eslint/no-magic-numbers": "off"
}
}
],