typescript-coding-standards
Installation
SKILL.md
TypeScript Coding Standards
Core Rules
- TS strict mode. Zero
any. Zero untyped exports. - Explicit return types on all exported functions.
- Interfaces for object shapes. Type aliases for unions/intersections.
- Async/await over raw promises. Always try/catch with typed errors.
- Optional chaining (?.) and nullish coalescing (??) over manual null checks.
- Never use non-null assertion (!) unless justified with a comment.
- const by default. let only when value changes. Never var.
- Destructuring for cleaner code. Template literals for string interpolation.
File Limits
- Functions: <40 lines. Extract if exceeding.
- Files: <300 lines. Split if exceeding.
- No dead code. No unused imports. No commented-out blocks.