| id | 180 | |
|---|---|---|
| title | Descriptive link text rule | |
| status | ✅ | |
| model | sonnet | |
| depends-on |
|
|
| summary | New rule MDS063 (provisional) for markdownlint MD059 descriptive-link-text — flag non-descriptive link text like "click here", "here", "link", "more". Opt-in, configurable phrase list, no autofix. |
Flag links whose visible text says nothing about the destination ("click here", "read more"). Such text fails screen readers and link-list navigation. This closes the MD059 gap from the linter comparison.
markdownlint MD059 ships a default banned list: click here, here, link, more. It compares the trimmed,
lowercased link text. mdsmith reuses the same default and
the same comparison so migrating users get parity.
MD054 link-image-style is a separate concern. It is
already owned by
plan 172. This rule is
link quality, not link style, so it is distinct. It
depends-on 172 only to keep the link rules in order.
-
Rule ID: MDS063 (provisional), category
prose, opt-in (subjective; should not regress existing docs). -
Config:
rules: descriptive-link-text: banned: ["click here", "here", "link", "more"]
bannedis replace-mode (document inApplySettings). -
Walk
*ast.Link; compare trimmed lowercased text to the list. No autofix — only the author knows the right text. -
Skip image links and links whose text is an inline code span only (often an API symbol, legitimately terse).
- ✅ Scaffold
internal/rules/descriptivelinktext/. - ✅ Implement the AST walk and phrase comparison.
- ✅ Implement
rule.Configurable(banned, replace-mode) andrule.Defaultablereturningfalse. - ✅ Fixture tests under the provisional
internal/rules/MDS063-*directory. - ✅ Rule README; regenerate the docs catalog and index.
- ✅ Add the MD059 row to the linter comparison.
-
[click here](x)is flagged;[the install guide](x)is clean. - Comparison is case- and whitespace-insensitive.
- A custom
bannedlist replaces the default. - Rule is disabled by default.
- All tests pass:
go test ./... -
go tool golangci-lint runreports no issues -
mdsmith check .passes