What problem does it solve?
TypeScript projects often suffer from inconsistent typing, scattered conventions, and maintenance burdens. This skill provides a structured set of best-practice guidelines to unify typing strategies, project configuration, and code organization, reducing bugs and improving readability.
Core Features & Use Cases
- Project configuration guidance: adopt strict compiler settings and a clean tsconfig to minimize runtime errors and improve tooling.
- Typing strategy guidance: choose between interface vs type, use type inference effectively, prefer unknown over any, and design robust public APIs.
- Code organization and patterns: establish clear module structure, barrel exports, and consistent file naming to simplify navigation and testing.
- Async patterns and error handling: apply safe async/await patterns, parallelize independent calls with Promise.all, and implement guard clauses.
- Quality and performance tips: leverage type-only imports, discriminated unions, and avoid excessive type complexity to keep builds fast and readable.
Quick Start
- Enable strict mode in tsconfig.json and adopt the recommended TypeScript configurations.
- Audit a sample module to decide between interface and type, replace any with unknown, and apply proper null/undefined handling.
- Refactor a utility module to use barrel exports and a clean module structure.