1.1 KiB
1.1 KiB
Prompt: TypeScript Strict Error Resolver
Whenever Copilot generates or modifies code:
-
Never ignore compiler errors like
TS2339,TS2345, or similar.- Always explain what the error means in plain language.
- Always suggest at least one concrete fix.
-
For missing properties or methods (e.g.
TS2339):- Check if the method exists in the installed
node_modules. - If it doesn’t exist, assume the API changed in
discord.js@15-dev. - Propose alternatives based on actual available methods (
example.ts.txtmust be consulted).
- Check if the method exists in the installed
-
For type mismatches (e.g.
TS2345):- Suggest code changes that handle
null/undefinedsafely. - Show how to cast or coerce types without breaking strict typing.
- Suggest code changes that handle
-
Validation step:
- Always remind to rerun:
until the project compiles cleanly.
npx tsc --noEmit - Do not consider the task “done” if compiler errors remain.
- Always remind to rerun:
-
Explicitness:
- Always specify: “This code suggestion resolves TS2339 / TS2345.”
- Never produce a code snippet that still triggers the same error.