💼 This rule is enabled in the 📋 template-lint-migration config.
Elements with ARIA roles must also include all required attributes for that role. This ensures that a given element possesses the necessary states and properties to behave consistently with user expectations for other elements with the same ARIA role.
This rule enforces that elements with an ARIA role also declare all required ARIA attributes for that role.
This rule forbids the following:
<template>
<div role="option" />
<CustomComponent role="checkbox" aria-required="true" />
{{some-component role="heading"}}
</template>This rule allows the following:
<template>
<div role="option" aria-selected="false" />
<CustomComponent role="checkbox" aria-required="true" aria-checked="false" />
{{some-component role="heading" aria-level="2"}}
</template>