TypeScript Style Guide
Prefer interface over type for object shapes. Use type for unions, intersections, and mapped types. Enable strict mode in every project.
Naming
Use PascalCase for types and interfaces, camelCase for variables and functions, UPPERSNAKECASE for constants. Prefix interfaces with nothing — no I prefix.
Error Handling
Avoid throwing raw strings. Define typed error classes or use a Result<T, E> pattern. Always handle promise rejections.