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 ruleP1stack specificStack: typescript
module-boundariesclient-serverimportsbundling
Don't import server-only types or modules into client code
Keep server and client boundaries clean: importing server-only types/modules into a client bundle drags in server dependencies and breaks the build; define shared types in a neutral location.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | // client component |
| 2 | import { IArticle } from 'src/server/models/entities/article'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // shared, framework-neutral location |
| 2 | import { IArticle } from 'src/shared/interfaces/article'; |
Explanation (EN)
Objašnjenje (HR)