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: JavaScript/TypeScript
performanceconstantsreadability
Define a constant value as a value, not a method
If a computed result never changes, compute it once as a constant instead of a function/method that recomputes it on every call.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | static getAppStoreUrl = () => 'https://apps.apple.com/.../id434568179'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | static APP_STORE_URL = 'https://apps.apple.com/.../id434568179'; |
Explanation (EN)
Objašnjenje (HR)