Skip to content
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

Closed
HamletDRC opened this issue Sep 7, 2016 · 1 comment
Closed

update rule: react-a11y-anchors - add HTML Code Sniffer checks #231

HamletDRC opened this issue Sep 7, 2016 · 1 comment
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.

Comments

@HamletDRC
Copy link
Member

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.

@JoshuaKGoldberg JoshuaKGoldberg added Status: Accepting PRs Difficulty: Medium People with non-trivial experience in TSLint should be able to send a pull request for this issue. Type: Rule Feature Adding a feature to an existing rule. Domain: Accessibility Rules around accessibility verification, commonly react-a11y-*. labels Jul 4, 2018
@JoshuaKGoldberg
Copy link

☠️ It's time! ☠️

Per #876, this repository is no longer accepting feature pull requests. TSLint is being deprecated and we recommend you switch to https://typescript-eslint.io.

Thanks for open sourcing with us, everyone!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
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.
Projects
None yet
Development

No branches or pull requests

2 participants