An ESLint plugin (v0.9.3, updated April 2026) that warns against unnecessary React useEffect hooks by detecting patterns where effects are synchronous or could be replaced with derived state, event handlers, or other React patterns. It encourages following the principle 'You Might Not Need an Effect' from the React docs. Unlike general React lint rules, this plugin specifically targets overuse of useEffect and provides auto-fix suggestions. Requires ESLint >=8.40.0 and Node >=14.0.0. Written in TypeScript, ships with types. The recommended and strict configs are included. Supports both flat and legacy ESLint configs.
Verified import paths — ran on the pinned version, not inferred.
Default import works in both ESM and CJS. For ESM, use the default import; for CJS, use require. The plugin also exports a flat config compatible version.
The correct named export is 'rules' (plural), not 'rule'. This gives access to the rule definitions dictionary.
Use 'configs' to access built-in configs like 'recommended' or 'strict'. For flat config, use configs['flat/recommended'].
Setup ESLint config to use the plugin with the strict config or custom rules, detecting unnecessary useEffect usage.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.