Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 431
Swati Dhurandhar Avatar asked Feb 19 '26 11:02

Swati Dhurandhar


2 Answers

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"
    }
  }
like image 146
Asad Ashraf Avatar answered Feb 20 '26 23:02

Asad Ashraf


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": {
...
}
like image 27
samir0067 Avatar answered Feb 20 '26 23:02

samir0067



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!