dillon1000/react
Commit
Browse files [eslint] Add an option to require dependencies on effect hooks (#33344)
Summary: To prepare for automatic effect dependencies, some codebases may want to codemod existing useEffect calls with no deps to include an explicit undefined second argument in order to preserve the "run on every render" behavior. In sufficiently large codebases, this may require a temporary enforcement period where all effects provide an explicit dependencies argument. Outside of migration, relying on a component to render can lead to real bugs, especially when working with memoization.
Changed paths2 files
First-parent comparisonpackages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js ModifiedM packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…