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 ruleP1universalStack: language-agnostic
correctnessapi-designflagsclean-code
Don't overload one flag to control unrelated behavior
A flag with an established meaning (e.g. disablePeriodicFetch to turn off polling) shouldn't be repurposed to also gate a different feature (push/SSE); use a dedicated condition.
PR: hegnar-components · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | if (disablePeriodicFetch) return; // also accidentally disables SSE |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | if (!sseUrl) return; // SSE gated by its own condition, polling flag stays separate |
Explanation (EN)
Objašnjenje (HR)