React useEffect Dependency Checker
Compare useEffect references and dependency arrays locally; review candidates, not a full React lint check.
useEffect Code
Analysis
What is React useEffect Dependency Checker?
Compare references read by a useEffect callback with its dependency array. The local JavaScript parser distinguishes strings, comments, property names and callback-local variables from external references. Findings are review candidates, not a React correctness verdict or a replacement for the official exhaustive-deps lint rule.
How to use React useEffect Dependency Checker
Paste an effect or its surrounding component as plain JavaScript and choose Check Dependencies. Multiple useEffect and React.useEffect calls are listed separately. JSX and TypeScript are not parsed; remove JSX returns or use your project’s React linter. Callbacks must be inline functions and dependency arrays must contain identifiers or static property paths. Dynamic arrays, spread, this/super, indirect callbacks and custom hooks are outside this comparison.
When is React useEffect Dependency Checker useful?
Start with useEffect(() => { console.log(count); }, []);. The result lists count as not covered by the array. Change the array to [count] and that reference is covered. For console.log(user.name), either [user.name] or [user] covers the read in this comparison. The property name name is not a separate variable. Review actual React behavior before editing dependencies; blindly adding values can change effect execution.
Example
Try useEffect(() => { const label = "hello"; console.log(label); }, []);. Neither the string hello nor the local label should be reported. Names captured by nested callbacks still count when declared outside the effect. Without a dependency array, React runs the effect after every commit; that is reported separately from an empty array. An extra listed value is shown as unreferenced here, not automatically wrong.
Practical notes
Your code is parsed locally and is never executed or sent to an analysis API. Surrounding plain-JavaScript context helps exclude module bindings and local declarations. An isolated snippet cannot identify the origin of every external name. Stable hook return values, component aliases, cleanup-specific rules and dependency-array ordering or duplicates are not validated. Run eslint-plugin-react-hooks/exhaustive-deps in your actual project for React’s rules, and test cleanup and changes to props and state.