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 ruleP1universalStack: any
validationdomain-modelcorrectnesstypo
Validate domain values against their real length, not a typo'd one
Check constants like currency codes against their actual format (ISO currency codes are 3 chars); a wrong length (4) silently rejects valid input.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | if (currency.length === 4) { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | if (currency.length === 3) { /* ISO 4217 codes are 3 chars */ } |
Explanation (EN)
Objašnjenje (HR)