PROMPT: Fix Typescript Errors

This prompt has been very effective for me when preparing for a production build with pnpm.

Run this: tsc --noEmit > tsc.log 2>&1

Then paste the output after this prompt:

We need to fix all type errors. Below is our type check log. You must consolidate your efforts to identify the entire list of affected files, then count the total number of files and fixes to make, prioritize them by files with the most fixes required, then only work on 5 files at a time, counting down until we have reviewed them all. I will tell you to continue after each set of 5 files so that we can move quickly:

Can we have the ability to store known good prompts in a prompt database with a dropdown that lets us select pre-planned activities such as this? Bonus points if we can chain them together in a prompt pipeline.

2 Likes

Great advice @DoctorDev2023 . Another helpful option is to prompt the prototyper with this

run 'npm run typecheck' and count the total number of errors. Your tasks to reduce the total error count by 10.

By having the model pace itself, it does a better job of solving Typescript errors. Eventually npm run typecheck will return 0 errors.

1 Like

When I tried to ask it to run commands on my behalf before it would give me responses like ‘I can’t run commands’ etc.

I’ll have to try that sometime, but I’ve already got a pretty solid workflow going now.

1 Like