dillon1000/react

Commit

[ESLint] Check deps when callback body is outside the Hook call, too (#18435)

* Refactor: visit CallExpression

Instead of visiting the functions and looking up to see if they're in a Hook call, visit Hook calls and look down to see if there's a callback inside. I will need this refactor so I can visit functions declared outside the call.

* Check deps when callback body is outside the Hook call

* Handle the unknown case
Browse files
Changed paths2 files
First-parent comparison
M packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js ModifiedM packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…