dillon1000/react
Commit
Browse files [eslint-plugin-react-hooks][RulesOfHooks] handle React.useEffect in addition to useEffect (#34076)
## Summary This is a fix for https://github.com/facebook/react/issues/34074 ## How did you test this change? I added tests in the eslint package, and ran `yarn jest`. After adding the new tests, I have this: On main | On this branch -|- <img width="356" height="88" alt="image" src="https://github.com/user-attachments/assets/4ae099a1-0156-4032-b2ca-635ebadcaa3f" /> | <img width="435" height="120" alt="image" src="https://github.com/user-attachments/assets/b06c04b8-6cec-43de-befa-a8b4dd20500e" /> ## Changes - Add tests to check that we are checking both `CallExpression` (`useEffect(`), and `MemberExpression` (`React.useEffect(`). To do that, I copied the `getNodeWithoutReactNamespace(` fn from `ExhaustiveDeps.ts` to `RulesOfHooks.ts`
Changed paths3 files
First-parent comparisonpackages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js ModifiedM packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js ModifiedM packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…