ariaUnsupportedElements
Reports ARIA attributes on elements that don't support them.
✅ This rule is included in the jsx logical preset.
Specific reserved DOM elements do not support ARIA roles, states, and properties.
Those elements generally are either not visible (like meta, script, style) or have specific semantic meaning (like body or html).
This is required for WCAG 4.1.2 compliance.
Examples
Section titled “Examples”<meta charset="UTF-8" aria-hidden="false" /><script role="application" /><style aria-label="styles" /><meta charset="UTF-8" /><script src="app.js" /><div role="button" />When Not To Use It
Section titled “When Not To Use It”You should always use this rule to ensure ARIA attributes are only applied to elements that support them.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.