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
abstractiondrydecouplingmaintainability
Decouple resource-link building behind a dedicated service method
Instead of inlining URL/key construction at each call site, expose a method on the owning service (e.g. createLink) so the logic lives in one place and can change later.
PR: hegnar-shareholders-ws · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | const url = `${s3.baseUrl}/${FolderName.COMPANY_LOGO}/${insref}`; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const url = this.s3Service.createLink(FolderName.COMPANY_LOGO, insref); |
Explanation (EN)
Objašnjenje (HR)