jsx-a11y/label-has-associated-controlrule to Astro components
Enforce that a label tag has a text label and an associated control.
There are two supported ways to associate a label with a control:
- Wrapping a control in a label tag.
htmlForto a label and assigning it a DOM ID string that indicates an input on the page.
This rule checks that any
labeltag (or an indicated custom component that will output a
labeltag) either (1) wraps an
inputelement (or an indicated custom component that will output an
inputtag) or (2) has an
htmlForattribute and that the
labeltag has text content.
📚 Further Reading
This rule was introduced in eslint-plugin-astro v0.11.0
🔍 Implementationfrom eslint-plugin-jsx-a11y
Edit this page