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 ruleP2stack specificStack: react
csslayoutredundancymarkupreadability
Avoid redundant wrapper elements and duplicated layout classes
Do not add a layout/grid wrapper when a child component already provides the same layout; redundant wrappers add noise and can cause double-applied styles.
PR: frontpage-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <div className="grid-x"> |
| 2 | {/* Row already renders its own grid-x wrapper internally */} |
| 3 | <Row items={items} /> |
| 4 | </div> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Row items={items} /> |
Explanation (EN)
Objašnjenje (HR)