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.
40 lines
1.2 KiB
JSON
40 lines
1.2 KiB
JSON
{
|
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
"plugins": ["typescript", "unicorn", "oxc", "import"],
|
|
"categories": {
|
|
"correctness": "error",
|
|
"suspicious": "error",
|
|
"perf": "warn",
|
|
"style": "warn",
|
|
"restriction": "error",
|
|
"nursery": "off"
|
|
},
|
|
"rules": {
|
|
"eslint/no-undefined": "off",
|
|
"eslint/sort-keys": "off",
|
|
"eslint/id-length": "off",
|
|
"import/no-named-export": "off",
|
|
"eslint/one-var": "off",
|
|
"import/group-exports": "off",
|
|
"import/exports-last": "off",
|
|
"eslint/sort-imports": "off",
|
|
"import/consistent-type-specifier-style": "off",
|
|
"unicorn/prefer-export-from": "off",
|
|
"typescript/method-signature-style": "off"
|
|
},
|
|
"options": { "typeAware": true },
|
|
"env": { "builtin": true, "es2024": true, "node": true },
|
|
"overrides": [
|
|
{
|
|
"files": ["**/*.test.ts"],
|
|
"rules": {
|
|
"no-unused-expressions": "off",
|
|
"no-empty-file": "off",
|
|
"import/no-nodejs-modules": "off",
|
|
"eslint/no-magic-numbers": "off"
|
|
}
|
|
}
|
|
],
|
|
"ignorePatterns": ["dist", "node_modules", "coverage"]
|
|
}
|