Skip to content

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

Description

@marcoroth

Implement the GitHub::Accessibility::AvoidGenericLinkText rule from erblint-github.

Rule Details

Avoid setting generic link text like "Click here", "Read more", and "Learn more" which do not make sense when read out of context.

Banned generic text:

  • Read more
  • Learn more
  • Click here
  • More
  • Link
  • Here

Examples

Incorrect code for this rule:

<a href="github.com/about">Learn more</a>
<a href="github.com/about">Read more</a>
<a href="github.com/new">Click here</a>

Correct code for this rule:

<a href="github.com/about">Learn more about GitHub</a>
<a href="github.com/new">Create a new repository</a>
<!-- not ideal but acceptable -->
<a aria-label="Learn more about GitHub" href="github.com/about">Learn more</a>

References

Parent Issue

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions