Skip to content

a11y/label-content-name-mismatch: one component on 24 locale copies is 69 errors, and is double-reported by identical-links-same-purpose #2226

Done

Description

@nc9

Source: MCP feedback fb_266 (run 01M7XFXVD1CCNXM5V1WJ510QPH, site incredible.one).

Seen. 25 pages are 24 locale copies of one page. a11y/label-content-name-mismatch reported 69 errors and was the editor summary's #1 priority ("error on all 25 pages"). Items are the same component per locale (visible "cellmark" vs aria-label "baca kisahnya" / "geschichte lesen" / ...; button "english" vs aria-label "language"). The same elements also produce a11y/identical-links-same-purpose (23 items), so one defect is reported three times. The mismatch is real for the card link (WCAG 2.5.3) but is one component fix.

Expected. Dedupe by (selector + visible text + normalized aria-label) across hreflang siblings and report once with "N locales"; cap an error's score contribution per unique component; do not run identical-links-same-purpose on elements the mismatch rule already flags. Related: private epic squirrelscan/repo#1880 (dedupe at the source).

Where. packages/rules/src/a11y/label-content-name-mismatch.ts, packages/rules/src/a11y/identical-links-same-purpose.ts.

Acceptance Criteria

  • The same elements are not reported by both label-content-name-mismatch and identical-links-same-purpose: identical-links-same-purpose skips a link whose visible text is missing from its aria-label (the condition label-content-name-mismatch already flags), with a fixture that has both rules' trigger on one link and asserts exactly one finding.
  • Links that only identical-links-same-purpose would flag (visible text inside the accessible name, same name with different targets) are still reported (existing tests green plus one new case).

Moved to pub#2236 (planning, 2026-11-22): collapsing one component across 24 locale copies into one finding, and counting it once in the score. Both rules are page-scope, so that needs a cross-page design first.

nik

Acceptance check (2026-11-25)

  • met: no double report; fixture with both triggers gives exactly one finding (re-checked): pub 1892d15 (fix(rules): identical-links-same-purpose skips links label-content-name-mismatch flags #2226 #2272) identical-links-same-purpose.ts uses visibleTextMissingFromAriaLabel to skip; test 'the same link is flagged by label-content-name-mismatch exactly once' toHaveLength(1)
  • met: links only identical-links flags still reported (+1 new case) (re-checked): new test 'a visible text inside the accessible name with different targets still warns'; packages/rules/tests/identical-links-same-purpose.test.ts 14 pass

Activity

  1. added
    bug
    size: M
    rules
    on Nov 22, 2026
  2. added theissue type on Nov 22, 2026
  3. nc9 commented on Nov 22, 2026

    @nc9
    ContributorAuthor

    Decision (planning, 2026-11-22): this issue now ships only the double-report fix. identical-links-same-purpose skips links whose visible text is missing from their aria-label, which is exactly what label-content-name-mismatch flags, so one problem gives one finding. The 24-locale collapse and the score counting it once moved to pub#2236. Both rules are page-scope, and mayCollapseAcrossPages has no consumer anywhere, so that part needs a design call first. The acceptance criteria above are updated to match.

    nik

  4. added
    in-progress
    on Nov 24, 2026
  5. self-assigned this
    on Nov 24, 2026
  6. removed their assignment
    on Nov 25, 2026
  7. removed
    in-progress
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrulessize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions