Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONARHTML-207 Create rule S6827: Anchors should contain accessible content #267

Merged
merged 4 commits into from
Feb 14, 2024

Conversation

yassin-kammoun-sonarsource
Copy link
Contributor

Inspired from anchor-has-content

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource force-pushed the SONARHTML-207 branch 2 times, most recently from 4d5edec to 3846188 Compare February 14, 2024 11:30
@ilia-kebets-sonarsource
Copy link
Contributor

ilia-kebets-sonarsource commented Feb 14, 2024

Why not capture the following cases:

<a />
<a><Bar aria-hidden /></a> <!--this one will need to be adapted to something that exists in HTML>

I tested all from https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/__tests__/src/rules/anchor-has-content-test.js

Copy link
Contributor

@ilia-kebets-sonarsource ilia-kebets-sonarsource left a comment

Choose a reason for hiding this comment

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

Last comment, otherwise LGTM!

@yassin-kammoun-sonarsource
Copy link
Contributor Author

yassin-kammoun-sonarsource commented Feb 14, 2024

Why not capture the following cases:

<a />
<a><Bar aria-hidden /></a> <!--this one will need to be adapted to something that exists in HTML>

I tested all from https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/__tests__/src/rules/anchor-has-content-test.js

I am not sure about <a><Bar aria-hidden /></a> as the behaviour of the undefined value is unpredictable.

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource merged commit b87eeb1 into master Feb 14, 2024
8 checks passed
@yassin-kammoun-sonarsource yassin-kammoun-sonarsource deleted the SONARHTML-207 branch February 14, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants