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).
frontend ruleP1universalStack: TypeScript
typescripttype-safetymodeling
Model domain data with explicit types, not loose strings
Type fields with their real shape (object or id) instead of a generic string when the value represents a structured entity.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | type FormFields = { |
| 2 | category: string; |
| 3 | ticker: string; |
| 4 | }; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | type FormFields = { |
| 2 | category: Category | null; |
| 3 | ticker: Ticker | null; |
| 4 | }; |
Explanation (EN)
Objašnjenje (HR)