'Getting warning in 'eslint-plugin-react-settings' while running eslint

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



Solution 1:[1]

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"
    }
  }

Solution 2:[2]

adding this in my .eslintrc file fixed the problem.

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Asad Ashraf
Solution 2 vedanth bora