O with occluded right edge to appear also as a C Open Web Components Guides Docs Blog Toggle darkmode

EsLint Plugin Lit A11y: anchor-has-content

Enforce that anchors have content and that the content is accessible to screen readers. Accessible means that it is not hidden using the aria-hidden attribute. Refer to the references to learn about why this is important.

Rule Details

This rule aims to...

Examples of incorrect code for this rule:

html`
  <a></a>
  <a><some-text-bearing-component aria-hidden></some-text-bearing-component></a>
`;

Examples of correct code for this rule:

html`
  <a>Anchor Content!</a>
  <a><some-text-bearing-component></some-text-bearing-component></a>
`;

Further Reading