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).
frontend ruleP2universalStack: javascript
importsside-effectsduplication
Don't import or invoke an initializer that an upstream import already runs
If a module you already import runs an initialization side effect, importing/calling it again duplicates the work; trace the import chain and remove the redundant call.
PR: hegnar-web · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codejavascript
| 1 | import '../../client/js/index'; // already calls setup() |
| 2 | setup(); // redundant |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | import '../../client/js/index'; // setup() runs via this import |
Explanation (EN)
Objašnjenje (HR)