Skip to content

link-text

Reports a link (<a href>) with no text, no image with an alt and no aria-label (WCAG H30). A link hidden from assistive technology is not reported.

A screen reader announces the link as “link” with no purpose, and a list of the links of a page shows an empty entry. Sighted users get a link they cannot see or have no name for.

To fix, put text in the link, or an image with an alt, or add aria-label.

Reported
...
<a href="x"><img alt="logo" src="a"></a>
<a href="x">text</a>
<a href="x" aria-label="n"><i></i></a>
<a href="x"><i></i></a>
...
<form><button>go</button></form>
<form id="f"></form><button form="f">go</button>
...
angular:
lint:
rules:
link-text: warn # off (default), warn, error
html:
lint:
rules:
link-text: warn # off (default), warn, error
svelte:
lint:
rules:
link-text: warn # off (default), warn, error
vue:
lint:
rules:
link-text: warn # off (default), warn, error

Enabled by the presets: html/html-validate-recommended.

Suppress one line with sudsy-disable-next-line link-text in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
html-validate wcag/h30 partial text of the link without the hidden parts, an img with alt or an aria-label inside; dynamic values are not told from static ones