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
diff-hygienegitreadabilitycomponents
Avoid large indentation-only changes that bloat diffs and cause conflicts
Wrapping content in a new container reindents everything and creates conflict-prone diffs. Introduce a small wrapper component that takes children so the existing indentation stays intact.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | // wrap <table> in two new <div>s, reindenting the whole block |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | function TableContainer({ children }) { return <div><div>{children}</div></div>; } |
| 2 | <TableContainer><table>...</table></TableContainer> // indentation preserved |
Explanation (EN)
Objašnjenje (HR)