Skip to content

Implement a11y-svg-has-accessible-text linter rule#1669

Open
joelhawksley wants to merge 4 commits into
marcoroth:mainfrom
joelhawksley:1226
Open

Implement a11y-svg-has-accessible-text linter rule#1669
joelhawksley wants to merge 4 commits into
marcoroth:mainfrom
joelhawksley:1226

Conversation

@joelhawksley
Copy link
Copy Markdown
Contributor

Add a new linter rule that ensures <svg> elements have accessible text. The rule reports an offense when an <svg> is missing all of the following:

  • aria-label attribute
  • aria-labelledby attribute
  • A nested <title> child element

SVGs marked as decorative with aria-hidden="true" are exempt.

Based on the erblint-github GitHub::Accessibility::SvgHasAccessibleText rule.

Closes #1226

@joelhawksley joelhawksley marked this pull request as draft April 22, 2026 15:33
@joelhawksley joelhawksley marked this pull request as ready for review April 22, 2026 19:29
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 8, 2026
Add a new linter rule that ensures `<svg>` elements have accessible text.
The rule reports an offense when an `<svg>` is missing all of the following:

- `aria-label` attribute
- `aria-labelledby` attribute
- A nested `<title>` child element

SVGs marked as decorative with `aria-hidden="true"` are exempt.

Based on the erblint-github `GitHub::Accessibility::SvgHasAccessibleText` rule.

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

Labels

a11y documentation Improvements or additions to documentation linter linter-rule typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linter: Implement a11y-svg-has-accessible-text rule

1 participant