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: node
importsconsistencyorganization
Import related modules through one consistent mechanism
Don't mix a barrel/aggregated import with a one-off direct import of the same kind of module; pick one approach and apply it consistently.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | import routes from './routes'; |
| 2 | import error404 from './routes/error404'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | import routes from './routes'; |
| 2 | // use routes.error404 |
Explanation (EN)
Objašnjenje (HR)