1.0.0 • Published 8 years ago

eslint-react-props-in-state-plugin v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

eslint-plugin-react-props-in-state

It reports several things:

  • When you do not have componentWillReceiveProps on components that depends on props
  • When you do not have nextProps argument on componentWillReceiveProps
  • When you do not use nextProps inside of componentWillReceiveProps
  • When you implicit use of this.props while mutating this.state

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-change-listeners:

$ npm install eslint-plugin-react-props-in-state --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-react-props-in-state globally.

Usage

Add react-props-in-state to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "react-props-in-state"
    ]
}