Skip to content

noAmbiguousAnchorText

biome.json
{
"linter": {
"rules": {
"nursery": {
"noAmbiguousAnchorText": "error"
}
}
}
}

Disallow ambiguous anchor descriptions.

Enforces <a> values are not exact matches for the phrases “click here”, “here”, “link”, “a link”, or “learn more”. Screen readers announce tags as links/interactive, but rely on values for context. Ambiguous anchor descriptions do not provide sufficient context for users.

<a>learn more</a>
code-block.html:1:1 lint/nursery/noAmbiguousAnchorText ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

No ambiguous anchor descriptions allowed.

> 1 │ <a>learn more</a>
^^^^^^^^^^^^^^^^^
2 │

Ambiguous anchor descriptions do not provide sufficient context for screen reader users. Provide more context to these users.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<a>documentation</a>

The words option allows users to modify the strings that can be checked for in the anchor text. Useful for specifying other words in other languages.

Default ["click here", "here", "link", "a link", "learn more"]

biome.json
{
"linter": {
"rules": {
"nursery": {
"noAmbiguousAnchorText": {
"options": {
"words": [
"click this"
]
}
}
}
}
}
}
<a>click this</a>