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

Add property for latest stable React release to be used with React settings #1981

Closed
bennycode opened this issue Sep 13, 2018 · 2 comments
Closed

Comments

@bennycode
Copy link

There is this warning when not specifying a React version in .eslint.js:

Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration.

Telling from the documentation, I can see that the default is to use the latest stable React release if no version is specified. That's great because in my case I always run on the latest stable release, so the default option is what suits me best. However, there is a warning when running eslint because I have no version specified in my config.

From the implementation I can see that the default version is just set to '999.999.999', so I can fix the warning (and get the default behaviour) by adding this to my .eslint.js:

"settings": {
  "react": {
    "version": "999.999.999"
  }
}

It would be much nicer though to declare "version": "latest" instead of "version": "999.999.999".

@ljharb
Copy link
Member

ljharb commented Sep 13, 2018

Duplicate of #1955.

@ljharb ljharb closed this as completed Sep 13, 2018
@footios
Copy link

footios commented Oct 21, 2021

This will automatically detect the React version

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

credits to vigilantly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants