Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Give boolean ARIA attributes explicit true/false values
Prefer explicit ARIA state values for readability, while distinguishing JSX boolean shorthand from raw HTML attribute syntax.
Bad example
| 1 | <Icon className="item-icon" aria-hidden /> |
Explanation (EN)
The explicit value communicates the accessibility state; both JSX spellings can serialize identically.
Objašnjenje (HR)
Good example
| 1 | <Icon className="item-icon" aria-hidden={true} /> |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
In JSX, prefer an explicit value for ARIA state attributes to make their accessibility meaning easy to inspect; check the rendered accessibility state.
Exceptions / Tradeoffs (EN)
Bare aria-hidden in JSX already means true and is not itself a React correctness bug. Raw HTML ARIA attributes require appropriate string values; they are not HTML boolean attributes.