Lint and Typecheck Fix
FeaturedOn demandTestingUp to 8 rounds
About Lint and Typecheck Fix
This manually started loop runs for at most 8 rounds. Each round runs lint and the TypeScript type check together, fixes whatever they report, and then checks again.
Key features
- 01Manual trigger, capped at 8 rounds
- 02One command covers both lint and type checking
- 03Uses tsc --noEmit, so no build output is produced
- 04Supports Cursor
Use cases
- 01Cleaning up accumulated lint and type errors on a branch before merging
- 02Fixing new errors after a dependency upgrade or config change
- 03Wrapping up after a broad change with a coding agent
- Goal
- Lint and typecheck report no errors.
- Exit when
- Stop when both npm run lint and npx tsc --noEmit exit with code 0, or when the 8-round limit is reached.
- Between iterations run
- npm run lint && npx tsc --noEmit
Launch prompt
Paste into Cursor. The agent repeats the steps below until the exit condition is met.
prompt.md
Start the "Lint and Typecheck Fix" loop. Goal: Lint and typecheck report no errors. Max iterations: 8. Step 1: Run lint and typecheck — Execute npm run lint && npx tsc --noEmit. Both exiting with code 0 counts as a pass; otherwise collect the reported errors. `npm run lint && npx tsc --noEmit` Step 2: Group the errors — Organize the output by file and rule, and handle the issues with the widest impact or those causing cascading errors first. Step 3: Fix the code — Edit the code to clear each error, avoiding rule suppression as a shortcut, then move on to the next round's check. Between iterations run: `npm run lint && npx tsc --noEmit` Exit when: Stop when both npm run lint and npx tsc --noEmit exit with code 0, or when the 8-round limit is reached.
Steps
Each round runs in order; if the exit condition isn’t met, another round starts, up to 8.
01
Run lint and typecheck
Execute npm run lint && npx tsc --noEmit. Both exiting with code 0 counts as a pass; otherwise collect the reported errors.
$
npm run lint && npx tsc --noEmit02
Group the errors
Organize the output by file and rule, and handle the issues with the widest impact or those causing cascading errors first.
03
Fix the code
Edit the code to clear each error, avoiding rule suppression as a shortcut, then move on to the next round's check.
Not met → next roundExits when met
Supported agents
Coding agents that can run this loop directly.
Cursor
Comments
Markdown supported