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 ruleP1stack specificStack: react
reactjsxsvgtypescript
Use camelCase for SVG presentation attributes in JSX
In JSX/TSX, write SVG attributes in camelCase (clipRule, fillRule, strokeWidth) rather than the HTML hyphenated form, which is invalid JSX and errors under strict TypeScript.
PR: hegnar-zephr-components · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <svg viewBox="0 0 16 16"> |
| 2 | <path clip-rule="evenodd" fill-rule="evenodd" d="..." /> |
| 3 | </svg> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <svg viewBox="0 0 16 16"> |
| 2 | <path clipRule="evenodd" fillRule="evenodd" d="..." /> |
| 3 | </svg> |
Explanation (EN)
Objašnjenje (HR)