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: react
nextjsarchitecturecomponentsseparation-of-concerns
Keep page files thin: compose sections, no inline styling or markup blocks
A page should mostly assemble section/feature components; move styling and reusable markup into dedicated components instead of living in the page.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codejsx
| 1 | // pages/index.tsx |
| 2 | <div className={styles.ctaBox}> |
| 3 | <h2>Tickers</h2>... |
| 4 | </div> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | // pages/index.tsx |
| 2 | <TickerCTA /> |
Explanation (EN)
Objašnjenje (HR)