jsx-a11y/anchor-is-validrule to Astro components
<a>element, with a valid
hrefattribute, is formally defined as representing a hyperlink. That is, a link between one HTML document and another, or between one location inside an HTML document and another location inside the same document.
In fact, the interactive, underlined
<a>element has become so synonymous with web navigation that this expectation has become entrenched inside browsers, assistive technologies such as screen readers and in how people generally expect the internet to behave. In short, anchors should navigate.
Whilst it is possible, for example, to turn the
<a>element into a fully functional
<button>element with ARIA, the native user agent implementations of HTML elements are to be preferred over custom ARIA solutions.
📚 Further Reading
This rule was introduced in eslint-plugin-astro v0.11.0
🔍 Implementationfrom eslint-plugin-jsx-a11y
Edit this page