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: typescript
correctnessdata-modellingedge-cases
Use an explicit backend flag over a fragile derived condition
Prefer a dedicated server-provided boolean (e.g. hasTransactions) over inferring state from a quantity that can hit zero.
PR: hegnar-forum-web · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codets
| 1 | if (holding.quantity > 0) showRemovalModal(); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | if (holding.hasTransactions) showRemovalModal(); |
Explanation (EN)
Objašnjenje (HR)