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: typescript
namingcopy-pastemaintainability
Rename classes, exports, and methods after copy-pasting a file
When a new controller/component is created by copying an old one, rename the class, its methods, and asset references to match the new purpose — leftover old names mislead and cause wrong asset wiring.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | class LandingPageController { // this file is actually the type page |
| 2 | public landingPage(): RequestHandler { ... } |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | class TypePageController { |
| 2 | public typePage(): RequestHandler { ... } |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)