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: javascript
modulesexportsconsistency
Export each symbol one way and match how it is imported
Don't export functions both individually and inside a namespace object if consumers only ever import one form; keep exports consistent with usage.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codejavascript
| 1 | export const sign = ...; |
| 2 | export const verify = ...; |
| 3 | export const jwt = { sign, verify }; // only jwt is ever imported |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | export const jwt = { sign, verify }; |
Explanation (EN)
Objašnjenje (HR)