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).
backend ruleP2project specificStack: node
next.jsssrreadability
Keep route data-loading logic readable and colocated
Avoid hiding getServerSideProps in a separate file when it forces reviewers to open multiple files to understand a route's params and fetches.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | // page.tsx |
| 2 | export { getServerSideProps } from 'utils/helpers/getTickerStandaloneProps.helpers'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // page.tsx — params and fetches visible where the route is defined |
| 2 | export const getServerSideProps = async ({ params }) => { /* ... */ }; |
Explanation (EN)
Objašnjenje (HR)