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

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

Merged

Conversation

sjgllghr
Copy link
Contributor

@sjgllghr sjgllghr commented Oct 4, 2018

Fixes #434.

Disallows:

<a />
<a href={null} />
<a href={undefined} />

Adds a check for if the href attribute is empty since getStringLiteral returns undefined when used on {...} type attribute values and throws an error when given an undefined attribute.

Also adds and modifies tests to follow this rule.

@msftclas
Copy link

msftclas commented Oct 4, 2018

CLA assistant check
All CLA requirements met.

Copy link

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@JoshuaKGoldberg JoshuaKGoldberg merged commit 7084f58 into microsoft:master Oct 4, 2018
@JoshuaKGoldberg JoshuaKGoldberg added this to the 6.0.0-beta0 milestone Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants