What problem does it solve?
This Skill provides a systematic approach to debugging and resolving TypeScript type errors, specifically targeting common anti-patterns and dangerous features (like any, as, !) that frequently lead to runtime issues. It helps developers write more robust, type-safe code and navigate complex refactoring with confidence.
Core Features & Use Cases
- Anti-Pattern Checklist: Guides on avoiding
any, as, !, and value is T for safer type assertions, promoting cleaner and more predictable code.
- Good Practices: Promotes
as const, satisfies, discriminated unions, and built-in narrowing for robust type inference and improved code readability.
- Troubleshooting Strategy: Provides a clear workflow for when to consult documentation, search issues, or ask the user, emphasizing persistence over "giving up" with
any.
- Use Case: When refactoring a large TypeScript module, use this skill to systematically address multiple type errors, ensuring each fix improves type safety without introducing new issues or compromising code quality.
Quick Start
I'm getting a TypeScript error in src/utils.ts related to an any type. Apply the typescript-debugger checklist to help me identify and fix the root cause without using any or as.