TypeScript Standards
This skill defines practical TypeScript standards for frontend code.
1. Defaults
- •Prefer strict settings (when possible).
- •Avoid
anyin application code. - •Use
unknownfor untrusted data until validated.
2. Types and imports
- •Prefer
import type { X }for type-only imports. - •Keep public types for a feature in
features/<feature>/types/.
3. API typing
- •Validate API responses at boundaries (runtime validation if needed).
- •Keep DTOs (wire types) separate from domain UI types when it reduces churn.