-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
[Fix]: label-has-associated-control
: ignore undetermined label text
#1004
Conversation
Fixes jsx-eslint#966 The rule no longer errors if the existence of label text cannot be determined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good! I'll confirm the tests fail without the fix, and then merge.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1004 +/- ##
=======================================
Coverage 99.03% 99.03%
=======================================
Files 107 107
Lines 1660 1660
Branches 588 588
=======================================
Hits 1644 1644
Misses 16 16 ☔ View full report in Codecov by Sentry. |
Attempt to fix #966
The rule no longer errors if the existence of label text cannot be determined. The criteria for not being able to determine whether the text exists are, for each child of the label:
I don't think this accounts for every case, but hopefully a good starting point
I followed the convention already used by making the new parameters for
mayHaveAccessibleLabel
optional, even though they're not. I assume that was to make it easier to write the unit tests. Happy to change that though if you'd like