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

Plugin Usage: Warning: React version not specified in eslint-plugin-react settings. #1963

Closed
bhardy opened this issue Aug 30, 2018 · 2 comments

Comments

@bhardy
Copy link

bhardy commented Aug 30, 2018

I am getting a similar issue to (#1955, #1857) where I receive the warning ( Warning: React version not specified in eslint-plugin-react settings) when I only add react to my plugins and not my extends. We only want to grab 2 rules from react. I have the settings object in my eslintrc.json with the "settings": { "react": { "version" : "16.3.2" }}, along with rules:

  "rules": {
    "semi": ["error", "always"],
    "eqeqeq": "off",
    "react/jsx-no-bind": "off",
    "react/no-deprecated": "error",
    "no-console": "error"
  }

If I put react (or "plugin:react/recommended" into extends I no longer receive the warning, but I don't want to extend the rules.

Please let me know if this is an issue or if I'm doing something wrong!

Thank you

@nikolas
Copy link

nikolas commented Jan 17, 2019

I'm getting this warning as well, even with plugin:react/recommended in extends. Here's my .eslintrc.json:

{
    "extends": ["eslint:recommended", "plugin:react/recommended"],
    "parser": "babel-eslint",
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": true
        }
    },
    "plugins": [
        "react"
    ],
    "env": {
        "browser": true,
        "es6": true
    },
    "rules": {
        "no-console": "off"
    }
}

The page this error links to (https://github.com/yannickcr/eslint-plugin-react#configuration) doesn't mention anything about specifying the React version in the eslint config. Should this warning just be removed?

@ljharb
Copy link
Member

ljharb commented Jan 17, 2019

@nikolas it definitely does; it’s listed there under “detect”. Regardless, if it didn’t, we’d need to fix the docs, not remove the warning.

I believe this issue should be fixed now in v7.12.4; closing.

Please file a new issue if it’s not.

@ljharb ljharb closed this as completed Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants