Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
fullstack ruleP1stack specificStack: TypeScript
typescripttypesprimitives
Use lowercase primitive types, not wrapper-object constructors, for type annotations
Annotate values with primitive types (string, number, boolean) rather than the boxed constructors (String, Number, Boolean) to avoid subtle type mismatches and confusion.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codets
| 1 | const [email, setEmail] = useState<String>(''); |
| 2 | interface Config { enabled: Boolean; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | const [email, setEmail] = useState<string>(''); |
| 2 | interface Config { enabled: boolean; } |
Explanation (EN)
Objašnjenje (HR)