✅ The extends: 'recommended'
property in a configuration file enables this rule.
Screen readers call up a dialog box that has a list of links from the page, which users refer to decide where they will go. But if many of the links in that list simply say "click here" or "more" they will be unable to use this feature in their screen reader, which is a core navigation strategy.
Additionally, when a link contains no content at all, the link's href ends up as the accessible name. This results in a poor experience and requires the user to resort to trial and error to determine the purpose of the link.
This rule checks links containing a few default words("click here" and "more"), and is configurable so additional words can be added as appropriate for your project. Disallowed list: click here, more info, read more, more. With the allowEmptyLinks
rule option set to false
, this rule also disallows links without accessible content.
This rule forbids the following:
With allowEmptyLinks: false
This rule allows the following:
With allowEmptyLinks: false
- boolean --
true
for enabled /false
for disabled - object -- Containing the following values:
allowEmptyLinks
- Whenfalse
, empty links are not allowed. Defaults tofalse
.