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

eslint rules should not silence the "react/jsx-key" rule #44

Closed
daileytj opened this issue Feb 25, 2022 · 5 comments · Fixed by #93
Closed

eslint rules should not silence the "react/jsx-key" rule #44

daileytj opened this issue Feb 25, 2022 · 5 comments · Fixed by #93
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering bug Something not working as expected external-dependency Depends on an upstream package or library hacktoberfest Issues shared for contributions by the Hacktoberfest community hacktoberfest2022 Issues shared for contributions by the Hacktoberfest community in 2022

Comments

@daileytj
Copy link
Contributor

daileytj commented Feb 25, 2022

Describe the bug

The eslint "react/jsx-key" rule has been temporarily set to false in the .eslintrc.js file to temporarily mute a known issue in eslint-plugin-react@7.29.0 linked at the bottom of this issue description.

What is the expected behavior?

This rule should not be disabled and there should be no linting errors when running yarn lint.

How to Recreate

  1. Clone this repo
  2. Remove the line in the file '.eslintrc.js' that disables the 'react/jsx-key' rule.
  3. Run yarn && yarn lint
  4. Observe the errors in the console.

Environment

Anything else to add?

jsx-eslint/eslint-plugin-react#3215
facebook/create-react-app#11825

Updating to version ^7.29.2 should fix the issue.

@daileytj daileytj added bug Something not working as expected needs-review Issues that we would like to revisit/review external-dependency Depends on an upstream package or library labels Feb 25, 2022
@jeffvg jeffvg removed the needs-review Issues that we would like to revisit/review label Mar 2, 2022
@joebochill
Copy link
Collaborator

@daileytj 7.29.2 of eslint-plugin-react seems to fix the underlying issue for this.

@joebochill joebochill added hacktoberfest2022 Issues shared for contributions by the Hacktoberfest community in 2022 hacktoberfest Issues shared for contributions by the Hacktoberfest community labels Sep 26, 2022
@AlanLes
Copy link

AlanLes commented Oct 1, 2022

Hello, there's some issue, do you know how may we handle this? 🤔 😉

ERROR in Plugin "react" was conflicted between ".eslintrc.js » @brightlayer-ui/eslint-config/tsx » plugin:react/recommended" and "BaseConfig » react-showcase-demo/node_modules/eslint-config-react-app/base.js".

@joebochill
Copy link
Collaborator

It looks like you might have two versions of the plugin installed. Did you use yarn to install/update the version (if you used npm, you might have created a second copy)?

For this issue, you should be able to just bump the plugin version in package.json, run yarn to update the lockfile, and then remove the 'react/jsx-key': 'off' rule in eslintrc.js

@joebochill
Copy link
Collaborator

I see what you were talking about now (when running the app). That looks like it's caused because the latest-version of react-scripts depends on an older version of the eslint-plugin-react. Changing ^7.29.2 to ~7.29.2 got us the latest 7.29 version (with the fix we needed) but didn't jump all the way to 7.31 which react-scripts won't allow yet.

@AlanLes
Copy link

AlanLes commented Oct 1, 2022

Yep, but it happened even if I updated to the mentioned by you, latest version 7.31.8. Because, you know, that was my first shot. I initially thought: "Why to bump this only to 7.29.2? Let's bump it to the latest and check what's gonna explode". 😅

@joebochill joebochill added the brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering label Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering bug Something not working as expected external-dependency Depends on an upstream package or library hacktoberfest Issues shared for contributions by the Hacktoberfest community hacktoberfest2022 Issues shared for contributions by the Hacktoberfest community in 2022
4 participants