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
namingarchitecturelayering
Name a class for what it actually does, not the layer folder it sits in
If a class only fetches/shapes data, call it a Provider/Service - don't label it a Controller just because of its location.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | class PartnerController { // only fetches and maps data |
| 2 | async getData() { /* ... */ } |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | class PartnerProvider { |
| 2 | async getData() { /* ... */ } |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)