What problem does it solve?
Provides a clear, enforceable set of TypeScript conventions to prevent runtime type errors, preserve literal typing, and ensure consistent validation at API boundaries so teams maintain high code quality and avoid subtle type-related bugs.
Core Features & Use Cases
- Compiler Configuration: Enforces strict compiler flags including strict and noUncheckedIndexedAccess to reduce accidental runtime failures.
- Boundary Safety & Validation: Treat external inputs as unknown, prefer Zod schemas for runtime validation, and centralize API boundary checks.
- Type Discipline: Prefer type guards and discriminated unions, use satisfies to preserve literal inference, avoid non-null assertions, and import types explicitly.
- Use Case: Use these guidelines when implementing frontend services or shared libraries (for example alt-frontend-sv, auth-token-manager, or alt-perf) to ensure predictable behavior and robust typing across modules.
Quick Start
Run a best-practices audit on any modified .ts or .tsx file and apply strict compiler settings, unknown-based boundaries, type guards, and Zod validation where external data is consumed.