eslint-plugin-react-you-might-not-need-an-effect weekly downloads statistics
By nickjvandyke · npm · ESLint plugins
ESLint plugin to catch unnecessary React effects for simpler, faster, safer code.
eslint-plugin-react-you-might-not-need-an-effect has 518,642 recorded weekly downloads on npm, a decrease of 12.3% over the past 30 days, ranking #267 of 2,391 tracked listings.
About eslint-plugin-react-you-might-not-need-an-effect
ESLint – React – You Might Not Need An Effect
ESLint (and Oxlint) plugin to catch unnecessary useEffects to make your React code easier to follow, faster to run, and less error-prone. Highly recommended for new React developers as you learn its mental model, and might surprise even experienced developers!
- Actionable fixes: Reports specific anti-patterns, with suggestions and links.
- Deep analysis: Analyzes state, props, refs, and their upstream sources.
- Dependency-aware: Considers when an effect runs to determine if its logic is actually redundant.
- Edge-case obsessed: Focuses on unusual syntax and heuristics to keep the signal-to-noise ratio high.
React's
eslint-plugin-react-hooks/set-state-in-effectrule flags synchronoussetStatecalls inside effects, helping prevent unnecessary re-renders. However, unnecessary effects go far beyond this, as I'm sure we've all seen (or written 😅).
📦 Installation
NPM
npm install --save-dev eslint-plugin-react-you-might-not-need-an-effect
Yarn
yarn add -D eslint-plugin-react-you-might-not-need-an-effect
⚙️ Configuration
Flat Config
// eslint.config.js
import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
import globals from "globals";
export default [
// Enable every rule as a warning
reactYouMightNotNeedAnEffect.configs.recommended,
// Or enable every rule as an error
reactYouMightNotNeedAnEffect.configs.strict,
// Or enable only specific rules
{
plugins: {
reactYouMightNotNeedAnEffect,
},
rules: {
"reactYouMightNotNeedAnEffect/no-derived-state": "warn",
},
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
},
];
Legacy Config
// .eslintrc
{
"extends": [
// Enable every rule as a warning
"plugin:react-you-might-not-need-an-effect/legacy-recommended",
// Or enable every rule as an error
"plugin:react-you-might-not-need-an-effect/legacy-strict",
],
// Or enable only specific rules
"plugins": ["react-you-might-not-need-an-effect"],
"rules": {
"react-you-might-not-need-an-effect/no-derived-state": "warn",
},
"env": {
"browser": true,
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
},
},
}
Oxlint
Use this plugin with Oxlint thanks to their JS plugin support!
// .oxlintrc.json
{
"jsPlugins": ["eslint-plugin-react-you-might-not-need-an-effect"],
"rules": {
"react-you-might-not-need-an-effect/no-derived-state": "warn",
"react-you-might-not-need-an-effect/no-chain-state-updates": "warn",
"react-you-might-not-need-an-effect/no-event-handler": "warn",
"react-you-might-not-need-an-effect/no-adjust-state-on-prop-change": "warn",
"react-you-might-not-need-an-effect/no-reset-all-state-on-prop-change": "warn",
"react-you-might-not-need-an-effect/no-pass-live-state-to-parent": "warn",
"react-you-might-not-need-an-effect/no-pass-data-to-parent": "warn",
"react-you-might-not-need-an-effect/no-external-store-subscription": "warn",
"react-you-might-not-need-an-effect/no-initialize-state": "warn",
},
"env": {
"browser": true,
},
}
Suggested
Enforce these other rules in your codebase for more accurate analysis:
react-hooks/exhaustive-deps— the plugin assumes your effects receive correct dependencies.typescript-eslint/no-floating-promises— helps the plugin infer calls to asynchronous functions.
🔎 Rules
See the tests for extensive (in)valid examples for each rule.
no-derived-state
Disallow storing derived state in an effect:
function Form() {
const [firstName, setFirstName] = useState("Taylor");
const [lastName, setLastName] = useState("Swift");
const [fullName, setFullName] = useState("");
useEffect(() => {
// ❌ Avoid storing derived state. Instead, compute "fullName" directly during render.
setFullName(firstName + " " + lastName);
}, [firstName, lastName]);
}
no-chain-state-updates
Disallow chaining state updates in an effect:
function Game() {
const [round, setRound] = useState(1);
const [isGameOver, setIsGameOver] = useState(false);
useEffect(() => {
if (round > 10) {
// ❌ Avoid chaining state changes. When possible, update "isGameOver" along with other relevant state simultaneously.
setIsGameOver(true);
}
}, [round]);
}
no-event-handler
Disallow using state and an effect as an event handler:
function Form() {
const [dataToSubmit, setDataToSubmit] = useState();…
Description from the npm listing.
- eslint
- eslintplugin
- eslint-plugin
- react
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm ESLint plugins plugins
All 20 eslint-plugin-react-you-might-not-need-an-effect alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/eslint-plugin-react-you-might-not-need-an-effect. First seen Oct 16, 2026; last successful collection Oct 21, 2026. See the methodology.