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 ruleP2stack specificStack: node
modulesdisimplicityconfiguration
Use a regular module instead of a dynamic one when nothing is configured per import
If a module's providers do not depend on per-import options, register it as a static module rather than a dynamic forRoot-style one.
PR: vinify-backend · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | @Module({}) |
| 2 | export class StripeModule { static forRoot() { ... } } // no varying config |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | @Module({ providers: [StripeService], exports: [StripeService] }) |
| 2 | export class StripeModule {} |
Explanation (EN)
Objašnjenje (HR)