Repository navigation
Description
a11y/link-text (packages/rules/src/a11y/link-text.ts) lists "sign up", "signup", "register", "subscribe", "join", "login", "log in" and "sign in" among its generic phrases, so a plain "Sign in" or "Sign up" link in a site header is reported as a link with generic text on every page that has the header.
A link that reads "Sign in", "Log out", "Terms", "Privacy", "Legal notice" or "DMCA" does name its destination. These are conventional account and site-utility labels, not "click here". Flagging them is noise, and it reads as one finding per page because the link sits in the template.
Seen in a real audit: two items ("sign in" and "signup") across 49 pages from the site header alone.
Change: take the account labels out of the generic list, and add a conventional-label set that is checked first and wins over the generic list. It covers account actions (sign in, sign up, log in, log out, register, my account) and legal or utility labels (terms, terms of service, privacy policy, legal notice, imprint, DMCA, cookies, accessibility, sitemap, contact, about, help, FAQ, careers). It is multilingual: the set is matched on the whole normalised link text and unioned across languages, so no page language detection is needed (the set can only remove findings, so a wrong entry never adds a false positive).
Scope: a11y/link-text. Check links/anchor-text and a11y/identical-links-same-purpose for the same labels and fix or file a follow-up. Generic phrases in other languages ("clic aqui", "mehr", "en savoir plus") are a separate issue.
Acceptance Criteria
- "sign in", "signin", "sign up", "signup", "log in", "login", "log out", "logout", "sign out", "register" and "my account" are never reported by
a11y/link-text, with case, punctuation and non-breaking space variants - Conventional legal and utility labels (terms, terms of service, terms and conditions, privacy, privacy policy, legal, legal notice, imprint, DMCA, cookies, cookie policy, accessibility, sitemap, contact, about, help, FAQ, careers) are never reported
- The set covers at least English, Spanish, French, German, Portuguese, Italian, Dutch, Japanese, Chinese, Korean and Russian, matched on the whole text after Unicode normalisation (NFKC, case folding, trailing and full-width punctuation), with a test per language
- "click here", "read more", "learn more", "here", "more", "link", "this", "go" and "continue" are still reported
- The labels live in one shared module so other link rules can reuse it;
links/anchor-textanda11y/identical-links-same-purposeare checked and either fixed or a follow-up is filed -
docs/rules/a11y/link-text.mdxis updated (the generic phrase count is corrected, the exempt labels and languages are documented) and the CHANGELOG has an entry - A real audit with "Sign in" and "Sign up" links in the header no longer reports them, and genuine generic links are still reported
Activity
fix(rules): a11y/link-text exempts conventional account and utility l…
fix(rules): skip legal pages in links/no-contextual-inbound; link-tex…
feat(classifier): page types, link sections and component-aware findi…