Skip to main content

require-accessible-name

Warn if the element has no accessible name. It is according to its ARIA role whether name required.

❌ Examples of incorrect code for this rule

<button>
<span></span>
<span></span>
<span></span>
</button>

✅ Examples of correct code for this rule

<button>
<span class="visually-hidden">Menu</span>
<span></span>
<span></span>
<span></span>
</button>

Interface

{
"require-accessible-name": boolean
}

Options

{
"require-accessible-name": {
"options": {
"ariaVersion"?: "1.1" | "1.2"
}
}
}
PropertyTypeDefault ValueDescription
ariaVersion"1.1" | "1.2""1.2"Choose the version of WAI-ARIA to evaluate.

Default Severity

error