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 ruleP2project specificStack: react
project-structurecomponentsorganization
Place reusable components in the shared folder, page-specific ones in views
Only put a component in the shared components/ directory if it is used in several places; components used by a single page belong under that page's views folder.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetext
| 1 | // components/MarketNews/MarketNews.tsx |
| 2 | // ...but it is only ever used by the watchlist page |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetext
| 1 | // views/watchlist/MarketNews/MarketNews.tsx |
| 2 | // shared components/ stays reserved for genuinely reused components |
Explanation (EN)
Objašnjenje (HR)