What I do
- •Standardize TypeScript error discovery for Bun/TypeScript projects.
- •Run safe, iterative fixes first and re-check after each batch.
- •Escalate only when changes become risky (functional behavior, large refactors, config workarounds).
Preferred discovery workflow
- •Run
moon run <project>:typecheck. - •Keep
:checkfor full hygiene runs, but iterate on:typecheckfor fast error-fix loops. - •Parse and group diagnostics by:
- •workspace file
- •external dependency file
- •TypeScript code (
TSxxxx)
Safe-fix policy
Apply only low-risk fixes automatically:
- •Add explicit local type annotations when intent is clear.
- •Correct obvious typos and symbol/import mismatches.
- •Add narrow guards for
null/undefinedchecks. - •Tighten object literal typing where schema/library APIs require explicit shape.
- •Replace incorrect implicit assumptions with typed helpers.
By default, ignore scripts/ diagnostics unless user explicitly asks to include script typing work.
Treat script files as shell-style automation where readability and reliability matter more than strict typing.
Do not auto-apply higher-risk changes unless user asked:
- •broad behavioral rewrites
- •large architecture refactors
- •tsconfig or compiler-option workaround changes
- •dependency major upgrades as a shortcut
any escalation rule
- •Avoid
anyby default. - •If remaining errors are blocked and best next step is
anyor broad cast workaround, ask once with a targeted question. - •If user approves, keep
anyscope minimal and track each use in the final report.
Iteration loop
- •Run typecheck and summarize top error groups.
- •Pick the lowest-risk actionable group in workspace files.
- •Apply focused fixes.
- •Re-run typecheck.
- •Repeat until:
- •no workspace errors remain, or
- •only risky/non-safe fixes remain.
Final report contract
- •Selected typecheck command and compiler version.
- •Total errors before/after.
- •Files changed and safe fix categories applied.
- •Remaining blocked errors (if any) and why.
- •
any/workaround ledger (explicit list, ornone).