Skip to content

Linter: Implement a11y-avoid-generic-link-text rule#1673

Merged
marcoroth merged 6 commits into
marcoroth:mainfrom
joelhawksley:1218
Jun 6, 2026
Merged

Linter: Implement a11y-avoid-generic-link-text rule#1673
marcoroth merged 6 commits into
marcoroth:mainfrom
joelhawksley:1218

Conversation

@joelhawksley
Copy link
Copy Markdown
Contributor

Implements the a11y-avoid-generic-link-text rule from erblint-github's AvoidGenericLinkText.

This rule flags <a> elements with generic link text such as "Read more", "Learn more", "Click here", "More", "Link", or "Here" which do not make sense when read out of context. Screen reader users often navigate by links, so descriptive link text is important for accessibility.

Links with aria-label or aria-labelledby attributes are not flagged, as those provide an accessible name. Links with dynamic ERB content are also skipped since the text cannot be statically analyzed.

The rule is disabled by default with a severity of warning.

Closes #1218

Implements the `a11y-avoid-generic-link-text` rule from erblint-github's `AvoidGenericLinkText`.

This rule flags `<a>` elements with generic link text such as "Read more", "Learn more", "Click here", "More", "Link", or "Here" which do not make sense when read out of context. Screen reader users often navigate by links, so descriptive link text is important for accessibility.

Links with `aria-label` or `aria-labelledby` attributes are not flagged, as those provide an accessible name. Links with dynamic ERB content are also skipped since the text cannot be statically analyzed.

The rule is disabled by default with a severity of `warning`.

Closes marcoroth#1218
@marcoroth marcoroth changed the title Implement a11y-avoid-generic-link-text linter rule Linter: Implement a11y-avoid-generic-link-text rule May 22, 2026
@marcoroth marcoroth merged commit 73a5063 into marcoroth:main Jun 6, 2026
12 checks passed
@marcoroth
Copy link
Copy Markdown
Owner

Thank you @joelhawksley! 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linter: Implement a11y-avoid-generic-link-text rule

2 participants