mirror of
https://github.com/stablyai/orca.git
synced 2026-09-21 16:02:20 +00:00
Enable eleven oxlint rules that simplify code without changing behavior, and fix
every existing violation. Each candidate was gated on measured cost rather than
assumption, so rules that regressed runtime performance or type checking were
dropped instead of suppressed.
typescript/no-redundant-type-constituents is the largest addition: 113 sites, no
autofix. Dead constituents are deleted. Where the redundant literal existed to
document intent (`string | 'all'`), it is preserved as `(string & {})`, which
keeps the autocomplete hint the original code was reaching for instead of
flattening it away. The rule also caught a broken import —
remote-shared-control-retirement-probe.ts pulled RuntimeStatus from
src/shared/types, which does not export it, so the type silently degraded to
`any`; no tsconfig covers that file, so tsc never saw it.
oxlint stays at 1.77.0 rather than 1.78.0 because .npmrc sets
minimum-release-age=4320 and 1.78.0 is younger than that window.
Rules evaluated and rejected, with what disqualified each:
- prefer-string-raw: String.raw is a runtime call, not a literal (184x slower)
- prefer-string-replace-all: 26% slower
- text-encoding-identifier-case: ~5% slower, reproducible
- prefer-spread: [...str] is 110% slower than split('') and differs on surrogates
- no-implicit-coercion: `!!x` narrows types and `Boolean(x)` does not (22 tsc errors)
- prefer-arrow-callback: arrows are not constructible, breaking `new` on mocks
- object-shorthand: rewrites source text asserted by a tracked reliability gate
- switch-case-braces: pushes ten files past max-lines, which cannot be suppressed
- no-useless-switch-case: drops `case undefined:` that switch-exhaustiveness-check needs
- arrow-body-style: 115 violations have no fix, and it breaks max-lines
- newline-after-import: false-positives on the leading-semicolon ASI idiom
electron-vite-output-contract asserted on the literal
Object.prototype.hasOwnProperty.call text; retarget it to Object.hasOwn, which
rejects inherited keys identically.
33 lines
836 B
JSON
33 lines
836 B
JSON
{
|
|
"$schema": "../node_modules/oxlint/configuration_schema.json",
|
|
"plugins": ["typescript"],
|
|
"categories": {
|
|
"correctness": "off",
|
|
"suspicious": "off",
|
|
"pedantic": "off",
|
|
"perf": "off",
|
|
"style": "off",
|
|
"restriction": "off",
|
|
"nursery": "off"
|
|
},
|
|
"rules": {
|
|
"typescript/await-thenable": "warn",
|
|
"typescript/no-redundant-type-constituents": "warn",
|
|
"typescript/restrict-plus-operands": "warn",
|
|
"typescript/restrict-template-expressions": "warn",
|
|
"typescript/switch-exhaustiveness-check": [
|
|
"error",
|
|
{ "allowDefaultCaseForExhaustiveSwitch": false }
|
|
]
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": ["**/*.test.*", "**/*.spec.*"],
|
|
"rules": {
|
|
"typescript/await-thenable": "off"
|
|
}
|
|
}
|
|
],
|
|
"ignorePatterns": ["**/node_modules", "**/dist", "**/out"]
|
|
}
|