-
Notifications
You must be signed in to change notification settings - Fork 109
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
chore: enable recommended ESLint plugin rules #681
Conversation
@nschonni Apologies for the delay in addressing this PR. Would you mind providing a bit of context as to what/why things were failing? I joined a bit after this issue and am wondering if it's still relevant. Thanks so much. |
@nikhilwoodruff Should we move ahead with this? |
b950006
to
191e332
Compare
Yep I think this is still worthwhile! |
I had not seen this PR before writing PRs #1080 and #1098 (sorry about the overlap!). The first change in the new PRs is the use of the eslint-react-app config. This includes accessibility checks and optional jest rules (that I have not activated). The second change is that I have not disabled any rules but instead fixed the errors in the code. In light of these changes, we have to figure out which parts of this PR still apply or need modification. I can see that the Jest and jsx-a11y parts still apply but disabling is not needed for many of the rules. |
Thanks for your input, @abhcs, I had meant to raise this with you early next week as I went through cleaning out a few almost-stale PRs. Since you teed it up, though, do you think there's value in separating out these recommended plugins as separate PRs? I'm anticipating that at least in a couple cases, there should be some pretty significant fixes that would have to be implemented should we activate them. |
"plugin:jest/recommended" has been enabled properly in this PR by fixing the errors. "plugin:jsx-a11y/recommended" has been enabled too but by disabling some of the rules. I am not sure what rules lie in "plugin:jsx-a11y/recommended" - "react-app" - {disabled rules in this PR}. If this set is non-empty, then there is value in adding "plugin:jsx-a11y/recommended" with the disabled rules. For simplicity, we can ignore "plugin:jsx-a11y/recommended" in this PR and handle it separately. I agree with your assessment that enabling these rules will require significant effort. |
Because of the previous lint-related PRs, this PR is now also like 50% merge conflicts... @abhcs What if instead we close this, then you open a new one enabling Alternatively, would you be willing to handle the merge conflicts of this PR, drop And what of the |
This would be valuable if we were using prettier through eslint but we are using prettier with eslint everywhere. So, it can be ignored. How about the following suggestion? I can open a PR that enables the plugins "jsx-a11y/mouse-events-have-key-events": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off" and with @nschonni 's fixes for Then, you can open four new issues -- one for each of the rules -- hopefully people will volunteer and fix the rules one by one. |
@abhcs Thanks for the details on prettier, and that sounds like a great plan |
Superseded by #1114. Closing. |
Turn on the recommended set of rules for the current plugins and turn off the currently failing rules. The rules should be enabled/fixed later.
🤖 Generated by Copilot at b950006
Summary
🔧✨♻️
This pull request improves the linting configuration for the project by updating the
.eslintrc.json
file and removing theeslintConfig
property from thepackage.json
file. These changes enhance the code quality, accessibility, and testing of the React app.Walkthrough
eslintConfig
property frompackage.json
(link)