eslint-plugin-react: react/no-deprecated rule not working

My eslint config:

{ "env": { "browser": true, "es6": true }, "extends": [ "eslint:recommended", "plugin:react/recommended" ], "parserOptions": { "ecmaFeatures": { "jsx": true }, "ecmaVersion": 2018, "sourceType": "module" }, "parser": "babel-eslint", "plugins": [ "react" ], "rules": { "linebreak-style": [ "error", "unix" ], "no-console": "warn" } }

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

Thanks. I managed to solve this problem. Now it works. I think my (old) global eslint was conflicting with local eslint.

Definitely you want to uninstall any global eslint stuff; almost everything should only be installed locally. Glad you figured it out!

Now my config is looks like, but this not working too:

{
  "env": {
    "browser": true,
    "es6": true
  },
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended"
  ],
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "parser": "babel-eslint",
  "plugins": [
    "react"
  ],
  "rules": {
    "linebreak-style": [
      "error",
      "unix"
    ],
    "no-console": "warn"
  },
  "settings": {
    "react": {
      "createClass": "createReactClass",
      "pragma": "React",
      "version": "16.3.0",
      "flowVersion": "0.53"
    },
    "propWrapperFunctions": [
      "forbidExtraProps"
    ]
  }
}

You don’t seem to be setting a React version number in settings - in what way is the rule not working for you? If you’re asking about React 16 deprecations, you’d have to be using v16.3+.