Skip to content

New Rule: descriptive-link-text #713

Description

@Grit03

Rule details

Warns when link text consists entirely of a generic phrase like "click here", "here", "link", or "more" that doesn't describe the link's destination and purpose

What type of rule is this?

Warns about a potential problem

Example code

<!-- Incorrect Cases -->

[click here](https://eslint.org/docs/latest/)

[here](https://eslint.org/docs/latest/)

[link](https://eslint.org/docs/latest/)

[more](https://eslint.org/docs/latest/)

[Click Here](https://eslint.org/docs/latest/)

[**click here**](https://eslint.org/docs/latest/)

[here][eslint-docs]

[eslint-docs]: https://eslint.org/docs/latest/




<!-- Correct Cases -->

[installation guide](https://example.com/docs)

See the [ESLint documentation](https://eslint.org/docs) for details.

[Click here to read the installation guide](https://example.com/docs)

Prior Art

markdownlint: MD059 / descriptive-link-text

added in v0.38.0 and enabled by default. It reports links whose text is one of a configurable list of prohibited phrases (default: ["click here", "here", "link", "more"]).

Participation

  • I am willing to submit a pull request to implement this rule.

AI acknowledgment

  • I did not use AI to generate this issue report.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

Additional comments

Generic link text is an accessibility problem: screen reader users often navigate a page by pulling up a list of its links out of context, and a list full of "here" and "click here" gives them no way to tell where each link leads. Descriptive link text is required by WCAG 2.4.4 (Link Purpose). This would follow the same accessibility track as require-alt-text (#365).

Like MD059, the rule would handle non-English phrases by letting users add them to the configurable prohibited list, rather than shipping per-language defaults.

On naming: descriptive-link-text matches the markdownlint rule name, but no-generic-link-text might fit this plugin's naming conventions better. No strong preference either way.

Disclosure: I'm a participant of open source contribution program OSSCA

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

  • Status
    Triaging

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions