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 ruleP2universalStack: TypeScript
dryclean-codereadability
Collapse duplicate branches into a single computation
If two variables or branches end up computing the same thing, use one; only keep the split if it adds genuine semantic clarity.
PR: vinify-backend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | const loggedOptions = this.getOptions(lang); |
| 2 | const guestOptions = this.getOptions(lang); // identical |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const options = this.getOptions(lang); |
Explanation (EN)
Objašnjenje (HR)