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 ruleP1stack specificStack: react
architectureimportsmodularityreact
Keep dependency direction one-way: shared components must not import from views/pages
Reusable/shared components should not import from feature/view modules; extract shared code into a common module so the dependency flows from views to components, never the reverse.
PR: vinify-frontend · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codets
| 1 | // in components/PdfPreview/helpers.ts |
| 2 | import { HeaderPosition } from 'views/wine-cellar/HeaderPosition'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | // Extract HeaderPosition into components/ first, then both views and |
| 2 | // components import it from the shared location. |
| 3 | import { HeaderPosition } from 'components/HeaderPosition'; |
Explanation (EN)
Objašnjenje (HR)