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
side-effectsmodule-loadingreadabilityglobals
Place behavior-altering global hooks at the top of the file
Code that monkey-patches modules or changes global behavior on import should sit at the top of the entry file so its effect is obvious.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | class HttpServer { /* ... */ } |
| 2 | require('source-map-support').install(); // hidden at the bottom |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | require('source-map-support').install(); // at the very top |
| 2 | class HttpServer { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)