Repository navigation
fix(rules): links/anchor-text evaluates links per target, not per link - #111
Merged
Merged
Conversation
#104) Groups a page's outgoing links by resolved target URL before flagging empty/generic anchor text. Card patterns (image link + headline link + 'Read more', all to the same target) pass as long as one member of the group carries a descriptive accessible name — matches the SEO intent of the rule instead of penalizing the recommended redundant-link pattern. Signed-off-by: Nik Cubrilovic <[email protected]>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #104
links/anchor-textused to score every<a>tag independently, so the standard card pattern (image link + headline link + "Read more" link, all pointing at the same target) produced two findings even though the headline already names the destination.This groups a page's outgoing links by resolved target URL and evaluates the group: a target passes if any member carries a descriptive accessible name (text, image
alt,aria-label,aria-labelledby,title, or an accessible SVG name).Acceptance Criteria
links/anchor-textgroups a page's outgoing links by resolved target URL before evaluatingempty-anchoronly when NO link in the group carries any accessible namegeneric-anchoronly when EVERY link in the group has generic textempty-anchorlinks/anchor-textupdated indocs/Test plan
bun run typecheck(packages/rules)bun test tests(packages/rules) — newtests/anchor-text.test.tscovers the grouping logicNote: this sandboxed session could not execute
bundirectly (blocked by session permissions), so tests were written and reasoned through but not run locally — CI should verify.