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 ruleP2project specificStack: react
muigridlayout
Mark layout-grid children as items
Direct children of a layout grid container should set the item flag so spacing and sizing props apply correctly and reduce extra CSS.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | <Grid container> |
| 2 | <Grid className={styles.cell}>...</Grid> |
| 3 | </Grid> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | <Grid container> |
| 2 | <Grid item className={styles.cell}>...</Grid> |
| 3 | </Grid> |
Explanation (EN)
Objašnjenje (HR)