-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Bug]: Warning: React version specified in eslint-plugin-react-settings must be a valid semver version, or "detect"; got “^17” #3857
Comments
Technically no, ranges are not part of the semver specification, they're something npm invented (although, they should be, and there's an open PR on the spec to add them). It's meant to target a specific version. is there a reason you can't use "detect"? |
I currently have "detect" on the .eslintc file. Are you referring to adding that tag somewhere else? |
No, that’s what i meant. If you have that setting, where does the ^17 come from? |
Well, from what I gather, the "detect" tag in .eslintc is making the plugin fetch the ^17 from my package.json (from the react dependency) and hence giving the warning. My package.json has this in the dependencies: |
The way "detect" works is it pulls the version number directly from the react you have installed on disk, so package.json shouldn't be involved at all (except in that it informs what ends up on disk). |
If not from my package.json then I don't where else it would retrieve ^17 from: |
Can you use |
Is there an existing issue for this?
Description Overview
I am getting this Warning message:
Warning: React version specified in eslint-plugin-react-settings must be a valid semver version, or "detect"; got “^17”
I have a .eslintrc file with this setup:
"settings": {
"react": {
"version": "detect"
},
Expected Behavior
This plugin should be able to cope with carets which are part of the semver specification
eslint-plugin-react version
v7.37.2
eslint version
v8.57.0
node version
v20.10.0
The text was updated successfully, but these errors were encountered: