This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
update rule: react-a11y-anchors - add HTML Code Sniffer checks #231
Labels
Difficulty: Medium
People with non-trivial experience in TSLint should be able to send a pull request for this issue.
Domain: Accessibility
Rules around accessibility verification, commonly react-a11y-*.
Status: Accepting PRs
Type: Rule Feature
Adding a feature to an existing rule.
From HTML Code Sniffer SC 4.1.2: Name, Role, Value (Level A) (
SC 4.1.2: Name, Role, Value (Level A)) (https://squizlabs.github.io/HTML_CodeSniffer/Standards/WCAG2/4_1_2)
• http://www.w3.org/TR/WCAG20-TECHS/H91
• Anchor element found with an ID but without a href or link text.
• Anchor element found with a name attribute but without a href or link text
• Anchor element found with no link content and no name and/or ID attribute
• Anchor element with no href, but with an ID and text. This breaks the intended role of an "A" element being a link. It will usually be around text inside another parent element (such as a heading); the ID should be moved up for the same effect.
• Link with text, but no href or ID. This means it does not have an accessibility API "value"
Link with a href attribute, but without link text. This means it does not have an accessibility API "name".
Notes:
"Links with the same HREF should have the same link text." You could keep as a static variable across all the files a map from link to link text and enforce this across files.
The text was updated successfully, but these errors were encountered: