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
nextjsproject-structurescssrouting
Keep style modules out of the routing pages directory
Place component styles with the component, not under the framework's pages/routing folder where they may not resolve and clutter routes.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetext
| 1 | pages/404/404.tsx |
| 2 | pages/404/404.module.scss // route becomes /404/404 |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetext
| 1 | pages/404.tsx |
| 2 | components/NotFound/NotFound.module.scss |
Explanation (EN)
Objašnjenje (HR)