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: any
readabilityconsistencyclean-code
Reference the already-derived local variable instead of re-reading the source
Once you've computed a value into a named variable, use that variable's properties rather than re-accessing the original object's equivalent field.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | const newThread = buildThreadFromSSE(event); |
| 2 | addAnimation(event.threadId); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const newThread = buildThreadFromSSE(event); |
| 2 | addAnimation(newThread.id); |
Explanation (EN)
Objašnjenje (HR)