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: general
correctnessdataui
Display values from the API rather than recomputing them client-side
If the backend already returns a computed figure, render it directly instead of redoing the math, which risks unit/scale bugs.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | {formatMillions(entry.marketCap / 100 * pct)} // re-deriving valueOfStocks, easy to get scale wrong |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | {formatMillions(entry.valueOfStocks)} // use the value the API already provides |
Explanation (EN)
Objašnjenje (HR)