13

Getting the:

warning: React version specified in eslint-plugin-react-settings must be a valid semver version, or "detect"; got “latest”' while running eslint.

What is the reason behind this and how to resolve it?

Screenshot of the issue

1
  • perhaps, fix your eslint-plugin-react-settings so it doesn't say latest Commented Mar 11, 2022 at 9:36

3 Answers 3

21

There will be an Object defined in your .eslintrc file as settings. And this error is saying that the version of react defined in it is not the version installed in your machine. Please replace settings object with following code so that es lint can detect it automatically on runtime.

"settings": {
    "react": {
      "version": "detect"
    }
  }
Sign up to request clarification or add additional context in comments.

Comments

6

Just add the code in the .eslintrc file (js,json) as this eslint will automatically detect the react version 👍

"plugins": [
...
],
"settings": {
  "react": {
    "version": "detect"
  }
},
"rules": {
...
}

Comments

2

adding this in my .eslintrc file fixed the problem.

"settings": {
    "react": {
      "version": "detect"
    }
  }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.