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 ruleP2project specificStack: TypeScript
consistencyhttpabstractiondry
Route requests through the shared fetch wrapper for consistency
When a project has a shared fetch/HTTP wrapper, use it for new requests instead of calling fetch directly, so headers, error handling and base URLs stay consistent.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | const res = await fetch(`${BASE}/portfolio/${id}`); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | const res = await portfolioFetch(`/portfolio/${id}`); // shared wrapper handles base URL + errors |
Explanation (EN)
Objašnjenje (HR)