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).
fullstack ruleP2stack specificStack: React Router/Remix
remixreact-routerloaderstypes
Throw redirects in loaders for cleaner data typing
In data-loader frameworks, throwing a redirect (vs returning it) keeps the loader's success return type clean for useLoaderData<typeof loader>.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | return redirect(`?${params}`, 307); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | throw redirect(`?${params}`, 307); |
Explanation (EN)
Objašnjenje (HR)