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: any
commentsrefactoringmaintainabilityintent
Preserve comments that explain why code exists before deleting them
Comments documenting non-obvious reasoning (why a hook stays, why an order matters) are guards against accidental regressions; don't strip them during a refactor.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetsx
| 1 | const prerenderScript = useMemo( |
| 2 | () => (<script ... />), |
| 3 | [] |
| 4 | ); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | // memoizing so that the script doesn't run on re-renders |
| 2 | const prerenderScript = useMemo( |
| 3 | () => (<script ... />), |
| 4 | [] |
| 5 | ); |
Explanation (EN)
Objašnjenje (HR)