- Strict type inference only. No
asassertions, noany, no!non-null assertions - No type annotations when inference works. Let TS infer return types, variable types
- Use
satisfiesoveraswhen type validation needed - ES modules only. No
require(), nodynamic import(), no conditional imports - Static imports at file top.
- KISS, DRY, single responsibility
- Functions over classes unless state/lifecycle needed
- Fail fast. No fallbacks, no retry mechanisms, no silent error swallowing
- Explicit errors over defensive coding
- Avoid
useEffect. Prefer event handlers, derived state, or lifecycle methods
| Element | Convention | Example |
|---|---|---|
| Files/Dirs | kebab-case | user-profile.ts |
| Classes | PascalCase | UserService |
| Functions | camelCase, verb-first | fetchUser, handleClick |
| Variables | camelCase | userData |
| Booleans | is/has/can prefix | isLoading, hasError |
| Constants | UPPER_SNAKE | MAX_RETRIES |