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 ruleP2stack specificStack: javascript
modulesexportsimportsclean-code
Use a default export for a module's single primary component
Export the main component as default so consumers can import it by a clean name without the /index path noise.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | export { Dashboard }; |
| 2 | import { Dashboard } from 'component/Dashboard/index'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | export default Dashboard; |
| 2 | import Dashboard from 'component/Dashboard'; |
Explanation (EN)
Objašnjenje (HR)