What problem does it solve?
This skill helps reduce TypeScript code quality issues by guiding you toward stronger type safety, clearer architecture, and safer error handling patterns that prevent common bugs and runtime failures.
Core Features & Use Cases
- Type safety guidance: Prefer
unknown over any, use narrowing and typed guards, and avoid risky ! non-null assertions.
- Robust error handling patterns: Adopt typed
Result-style flows and structured error types/codes for predictable recovery paths.
- Maintainable code organization: Promote single-concept modules, explicit exports, and consistent API/interface design.
- Static analysis via scripts: Run a Deno-based analyzer to detect anti-patterns (e.g.,
any, @ts-ignore, eval, innerHTML assignments) across a file or directory.
- Scaffolding and generation: Generate TypeScript types from JSON inputs and scaffold well-structured modules (including optional tests).
Quick Start
Ask: "Use typescript-best-practices to analyze ./src for TypeScript anti-patterns and suggest fixes for any issues you find."