-
Notifications
You must be signed in to change notification settings - Fork 2k
chore: configure eslint plugin jsx a11y #20060
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
base: main
Are you sure you want to change the base?
chore: configure eslint plugin jsx a11y #20060
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hey @tay1orjones Question: Should I include removing these TypeScript ignores as part of this PR? Considerations: My recommendation: Keep this PR focused on just adding jsx-a11y, then tackle TypeScript file linting in a follow-up PR where we can address any issues that surface more systematically. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20060 +/- ##
==========================================
+ Coverage 91.28% 91.39% +0.10%
==========================================
Files 481 485 +4
Lines 30569 31370 +801
Branches 5423 5478 +55
==========================================
+ Hits 27906 28670 +764
- Misses 2509 2547 +38
+ Partials 154 153 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
a6979f2
to
e5717ba
Compare
Note on additional changes: While implementing jsx-a11y, I encountered linting issues where react-hooks/rules-of-hooks was throwing "Definition for rule not found" errors. Since we already have an issue for installing eslint-plugin-react-hooks, I went ahead and resolved it in this same PR to unblock the jsx-a11y implementation. Installed eslint-plugin-react-hooks |
I have intentionally removed the react hook disable for reviewers to review that lint fails and our config works. . Will add back once I get reviews. |
No, I think that should probably be a separate PR. @adamalston I remembered you mentioning it in #19658, did you have any work in progress for enabling processing on typescript files? If not, I can open a new issue with some ideas. It's possible we could
This aims for benefits of:
|
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.
LGTM! Does need yarn dedupe
ran and the changes pushed up though
I went ahead and opened #20071 just so we don't lose track of enabling typescript |
Yea, I worked on it. I stashed the changes locally to focus on some internal commitments. I was hoping to get back to it soon, but I can't commit to a specific timeline. So if it's urgent, someone else is welcome to pick it up. |
Closes #19013
Closes #19005
Add eslint-plugin-jsx-a11y for accessibility linting
Installed eslint-plugin-react-hooks
Changelog
New
Changed
Testing / Reviewing
-Create a test file with
<img src="test.jpg" />
(missing alt) - should error<div tabIndex="3">
(positive tabIndex) - should error<div onClick={() => {}}>
(missing keyboard handler) - should errorexport default TestComponent;
Screenshots of my local testing
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
Updated documentation and storybook examplesWrote passing tests that cover this changeAddressed any impact on accessibility (a11y)Tested for cross-browser consistencyMore details can be found in the pull request guide