Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Place one-off components near their usage
Store single-use components in a _components folder at the highest level where they are used to keep structure local and navigable.
Bad example
| 1 | // One-off component placed in global components folder |
| 2 | export function HeroStats() { |
| 3 | return <div>...</div>; |
| 4 | } |
Explanation (EN)
One-off components living in global folders make the structure noisy and harder to navigate. It becomes unclear which components are reusable.
Objašnjenje (HR)
One-off komponente u globalnim folderima čine strukturu bučnom i težom za navigaciju. Nije jasno što je reusable.
Good example
| 1 | // app/page/_components/hero-stats.tsx |
| 2 | export function HeroStats() { |
| 3 | return <div>...</div>; |
| 4 | } |
Explanation (EN)
Keeping one-off components close to their usage makes ownership and intent clear.
Objašnjenje (HR)
Držanje one-off komponenti blizu mjesta korištenja čini vlasništvo i namjenu jasnima.