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).
backend ruleP2universalStack: universal
namingdeprecationapimigration
Name the new implementation cleanly and mark the old one deprecated
When replacing a method/route, give the new one the canonical name and rename+deprecate the legacy one rather than suffixing the new code.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | export const getHotThreads = () => { /* legacy */ }; |
| 2 | export const getHotThreadsNew = () => { /* new */ }; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | /** @deprecated use getHotThreads */ |
| 2 | export const getHotThreadsLegacy = () => { /* legacy */ }; |
| 3 | export const getHotThreads = () => { /* new */ }; |
Explanation (EN)
Objašnjenje (HR)