typescript-best-practices
Installation
SKILL.md
TypeScript Best Practices
When to Apply
Apply these rules when:
- Writing new TypeScript code
- Reviewing TypeScript code
- Refactoring JavaScript to TypeScript
- Fixing type errors
- Optimizing type definitions
Core Rules
1. Avoid any - Use Proper Types
Never use any unless absolutely necessary. Instead:
- Use
unknownfor truly unknown types - Use generics for flexible typing
- Use union types for multiple possibilities