Skip to content

ariaUnsupportedElements

Reports ARIA attributes on elements that don't support them.

✅ This rule is included in the jsx logical and logicalStrict presets.

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.

<
JSX.IntrinsicElements.meta: DetailedHTMLProps<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>
meta
charset="UTF-8"
AriaAttributes["aria-hidden"]?: Booleanish | undefined

Indicates whether the element is exposed to an accessibility API.

@seearia-disabled.

aria-hidden
="false" />
Error ts(2322) ― Type '{ charset: string; "aria-hidden": "false"; }' is not assignable to type 'DetailedHTMLProps<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>'. Property 'charset' does not exist on type 'DetailedHTMLProps<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>'. Did you mean 'charSet'?
<
JSX.IntrinsicElements.script: DetailedHTMLProps<ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>
script
HTMLAttributes<HTMLScriptElement>.role?: AriaRole | undefined
role
="application" />
<
JSX.IntrinsicElements.style: DetailedHTMLProps<StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>
style
AriaAttributes["aria-label"]?: string | undefined

Defines a string value that labels the current element.

@seearia-labelledby.

aria-label
="styles" />

You should always use this rule to ensure ARIA attributes are only applied to elements that support them.

Made with ❤️‍🔥 around the world by the Flint team and contributors.