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 ruleP2universalStack: any
organizationcohesionclean-codemodularity
Place code in the module that matches its responsibility
Generic, reusable code (e.g. a serializer) doesn't belong in a feature-specific file; move it to a fitting location.
PR: hegnar-ws · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | // in article.service.ts |
| 2 | export class Serializer<T, DTO> { /* generic, unrelated to Article */ } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // in serializer.ts |
| 2 | export class Serializer<T, DTO> { /* shared serialization utility */ } |
Explanation (EN)
Objašnjenje (HR)