element-supports-aria-prop
Warns when an aria-* attribute is disallowed by an element-specific restriction defined by ARIA in HTML, regardless of the element's computed role:
- Element-specific prohibitions — every
aria-*attribute is forbidden on certain element states (e.g.<input type="hidden">), and individual attributes may be forbidden when another attribute is present or when the element sits in a specific parent context (e.g.aria-expandedon<button popovertarget>or<button commandfor>because the popover / Invoker Commands API manages the state automatically;aria-expandedandaria-pressedon the first<summary>inside<details>because the expanded state maps to theopenattribute). - Element-specific whitelist — some elements accept only a small set of
aria-*attributes (e.g.<br>and<wbr>accept onlyaria-hidden); any attribute outside the whitelist is rejected.
Split out of the former wai-aria-disallowed-props rule, alongside no-prohibited-naming and role-supports-aria-prop. The former rule's disallowSetImplicitProps option gated this check; disabling this rule entirely is how to opt out now.
❌ Examples of incorrect code for this rule
<br aria-atomic="true" />
<input type="hidden" aria-hidden="true" />
<button popovertarget="p" aria-expanded="false">Toggle</button>
<button command="toggle-popover" commandfor="p" aria-expanded="false">Toggle</button>
<details>
<summary aria-expanded="false">Summary</summary>
</details>
✅ Examples of correct code for this rule
<br aria-hidden="true" />
<input type="hidden" />
<button popovertarget="p">Toggle</button>
<button command="toggle-popover" commandfor="p">Toggle</button>
<details>
<summary>Summary</summary>
</details>
Interface
{
"element-supports-aria-prop": boolean
}
Default Severity
error