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).
frontend ruleP1universalStack: react
accessibilitybundle-sizedead-code
Remove unused components from the page, don't just display:none them
Hiding a component with display:none still ships it in the bundle and harms accessibility; remove it from the render tree (keep the source if you'll reuse it) instead of leaving it present but invisible.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codecss
| 1 | .sourcePicker { display: none; } // component still rendered & bundled |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | // remove <SourcePicker /> from the page render; keep the folder for later |
Explanation (EN)
Objašnjenje (HR)