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: node
packagingexportsapi-designnpm
Expose clean package subpath exports for consumers
Define package exports so consumers can import from a short subpath (e.g. pkg/react) instead of reaching into dist internals.
PR: hegnar-components · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | import { ReplyEditor } from '@scope/pkg/dist/react-components'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // package.json exports map -> consumers do: |
| 2 | import { ReplyEditor } from '@scope/pkg/react'; |
Explanation (EN)
Objašnjenje (HR)