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
dead-codetemplatessimplicitycomponents
Trim vendored template components to what you actually use
Templates like shadcn/ui are starting points: delete unused parts (e.g. TableFooter), drop forwardRef/displayName where not needed, and simplify pass-through components to the underlying element.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | const TableRow = React.forwardRef((props, ref) => <tr ref={ref} {...props} />); |
| 2 | TableRow.displayName = 'TableRow'; // no added behavior |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | const TableRow = 'tr'; // expand later only if needed |
Explanation (EN)
Objašnjenje (HR)