fix-typescript
Fix TypeScript Errors
Fix TypeScript type errors for runtime type safety, not just to satisfy the linter. If a fix would pass tsc but could still crash at runtime, it's wrong.
Forbidden patterns
The canonical, exhaustive forbidden-pattern table — as any, as unknown as, @ts-ignore / @ts-expect-error, void tricks, underscore-prefixed unused locals, non-null assertions without a guard, forEach(async, and exported unused types, each with severity and acceptable/unacceptable examples — lives in the /catalyst-dev:scan-reward-hacking skill. Run it before marking this work complete; don't re-derive the list here.
Two more rules are process-level, not grep-able code patterns, so /catalyst-dev:scan-reward-hacking doesn't scan for them — they are still forbidden:
- Commenting out code instead of deleting it (git has history).
- Excluding files from
tsconfigto hide errors instead of fixing them.
Stricter than the canonical scan
Three cases the canonical scan accepts are not acceptable here, because you are actively fixing the error rather than auditing pre-existing code: an exported-but-unused type must be removed or unexported outright, not left as the canonical scan's informational note; @ts-ignore / @ts-expect-error are never acceptable, even with a documented reason and tracking ticket — fix the error instead of suppressing it; and a test mock's as any is not a license to introduce a new one while you're resolving a production type error.