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 ruleP2universalStack: React
configpropssimplificationstate
Drive option/button lists from a single config rather than filtering a master list
Pass the available options directly as config instead of declaring a full set plus a separate hidden/filtered list; it removes the derived filtering state.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | const filtered = ALL_BUTTONS.filter(b => !hiddenSortButtons.includes(b)); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Sort options={availableSortButtons} /> // pass exactly what should show |
Explanation (EN)
Objašnjenje (HR)