Colocate page files with their route segment
Keep page.tsx, layout.tsx, loading.tsx, and error.tsx together in the same route segment directory.
Why This Matters
Scattering related files across directories increases navigation time and makes data dependencies unclear.
Tags
nextjssupabase
Related Rules
Catch this automatically on every PR
BeforeMerge scans your pull requests against this rule and 2+ others. Get actionable feedback before code ships.