Skip to content

anchorContent

Reports anchor elements without accessible content.

✅ This rule is included in the jsx logical preset.

Automated tools such as screen readers and search engine crawlers rely on anchors (links) having contents to understand those links. If anchor is missing accessible content, then it will not be properly understood.

This rule checks that all anchors either have child content or an ARIA property describing the anchor.

<a />
<a></a>
<a>
<span aria-hidden />
</a>

If you are using a framework that automatically generates accessible content for anchors, you can safely disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.