Testing: Add lint rule to forbid <a title>
#20198
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
Needs Dev
Ready for, and needs developer efforts
[Type] Automated Testing
Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
[Type] Task
Issues or PRs that have been broken down into an individual action to take
Related: #19990, #19735
Based on the following resources, it is my understanding that we should never want to include a
title
attribute on a link.Much like how we already use
eslint-plugin-jsx-a11y
for linting various accessibility issues in JSX usage, we should be able to forbid the use of this attribute on links.Implementation Notes:
It is unclear if this might be best implemented as:
eslint-plugin-jsx-a11y
which is then incorporated into this project.no-restricted-syntax
.@wordpress/eslint-plugin
, and whether or not that should be part of its bundledrecommended
ruleset.Important note:
title
attributes can be expected (encouraged even) for some non-link elements, so the rule should be made specific to links.Recommendation: An upstream patch could serve as useful validation of the idea. Even if rejected and still desirable for our own project, the implementation could be reused for a custom rule.
The text was updated successfully, but these errors were encountered: