Accessibility
link-text
Forbid empty anchors and generic "click here" link text.
Flags anchor tags with no visible text and the generic phrases ("click here", "read more", "learn more") that strip a link of its semantic purpose. Screen-reader users navigate by listing links — generic text removes the link's entire signal.
Behavior
- Fixable: No.
- Suggestions: No.
- Maps to: WCAG 2.4.4 (Link Purpose, In Context).
Examples
Bad:
<a href="/pricing">click here</a>Good:
<a href="/pricing">View pricing plans</a>Related rules
prefer-semantic-htmlPrefer semantic HTML over <div onClick> and redundant ARIA roles.heading-hierarchyEnforce sequential heading levels and at most one <h1> per file.image-alt-textRequire meaningful alt text on every <img> element.
Use it
Enable link-text in your eslint.config.js:
import deslint from '@deslint/eslint-plugin';
export default [
{
plugins: { deslint },
rules: {
'deslint/link-text': 'error',
},
},
];Found a false positive? Report it on GitHub →