github / eslint-plugin-github

An opinionated collection of ESLint rules used by GitHub.
MIT License
286 stars 51 forks source link

Adds `svg-has-accessible-name` rule #450

Closed lindseywild closed 11 months ago

lindseywild commented 11 months ago

Relates to https://github.com/github/accessibility/issues/3972.

Description

Adds a lint rule to ensure SVGs have an accessible name by checking for a title element as the first descendant of the <svg> element or an aria-label or aria-labelledby. It also checks if the element is presentational, in which an error won't be thrown.