link-text
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: offhtml/html-validate-recommended
What it does
Section titled “What it does”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.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”...<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>...Configuration
Section titled “Configuration”angular: lint: rules: link-text: warn # off (default), warn, errorhtml: lint: rules: link-text: warn # off (default), warn, errorsvelte: lint: rules: link-text: warn # off (default), warn, errorvue: lint: rules: link-text: warn # off (default), warn, errorEnabled 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.
Upstream equivalents
Section titled “Upstream equivalents”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 |