An ESLint plugin that enforces functional setState in React components and prevents direct access to this.state and this.props inside setState calls. Version 1.2.1 is the current stable release. The plugin has a single rule, no-this-state-props, which flags any use of this.state or this.props within setState arguments. It is a lightweight, focused tool for React codebases that aim to follow the recommended functional setState pattern. The plugin is designed for ESLint and requires Node >= 0.10.0. It has no other runtime dependencies beyond ESLint. Compared to broader React ESLint plugins like eslint-plugin-react-hooks or eslint-plugin-react, this plugin serves a very specific linting purpose and does not handle other React best practices.
npm install eslint-plugin-react-functional-set-stateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures ESLint plugin to enforce functional setState and shows an example of correct vs incorrect usage.
Use require() in your ESLint config file, or use a dynamic import if using .mjs config (but require is simpler).
Use additional React linting rules (e.g., react/no-direct-mutation-state) for other state access patterns.
Update your ESLint configuration if you referenced rule files directly; otherwise, no change needed.
Manually review code for patterns like `const s = this.state; this.setState({ foo: s.bar })`.Run `npm install eslint-plugin-react-functional-set-state --save-dev` and ensure ESLint is installed in the same project.
Verify that the rule name is exactly 'react-functional-set-state/no-this-state-props' and that the plugin is included in the plugins array.
Update ESLint to a version that supports the plugin (>=4.0.0) and ensure the plugin version is 1.2.0 or later.
No dependency data recorded yet.