Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

react-a11y-anchors should warn when there is no href attribute #434

Closed
astorije opened this issue Jun 5, 2018 · 1 comment
Closed

react-a11y-anchors should warn when there is no href attribute #434

astorije opened this issue Jun 5, 2018 · 1 comment
Labels
Difficulty: Easy Someone with little to no 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.
Milestone

Comments

@astorije
Copy link
Contributor

astorije commented Jun 5, 2018

At the moment, this plugin warns on <a href="#">Foobar</a> but it doesn't warn on <a>Foobar</a>. Thoughts on making it warn for this case as well?

For comparison, eslint-plugin-jsx-a11y's anchor-is-valid warns on those:

<a />
<a href={undefined} />
<a href={null} />
@JoshuaKGoldberg JoshuaKGoldberg added Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Domain: Accessibility Rules around accessibility verification, commonly react-a11y-*. Type: Rule Feature Adding a feature to an existing rule. Status: Accepting PRs labels Jul 4, 2018
@sjgllghr
Copy link
Contributor

sjgllghr commented Oct 3, 2018

If no one else is working on it, I'd like to look into this.

Just to be sure, should this test fail now since we're requiring href, or should it depend on role?
https://github.com/Microsoft/tslint-microsoft-contrib/blob/eac676244291b5dbb8720395d38e2a7929f7e427/src/tests/ReactA11yAnchorsRuleTests.ts#L105-L115

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Easy Someone with little to no 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

3 participants