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: typescript
typescriptpropsreactcorrectness
Keep a component's prop interface aligned with its actual props
Ensure the declared props interface matches the props the component actually destructures and uses.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetsx
| 1 | interface TableBodyProps { rows: Row[]; onSort: () => void; } |
| 2 | const TableBody = ({ rows, onClick }: any) => <tbody onClick={onClick}>...</tbody>; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | interface TableBodyProps { rows: Row[]; onClick: () => void; } |
| 2 | const TableBody = ({ rows, onClick }: TableBodyProps) => <tbody onClick={onClick}>...</tbody>; |
Explanation (EN)
Objašnjenje (HR)