diff --git a/.eslintrc.js b/.eslintrc.js index 38992de398e51..22cb9209b2e9e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -322,6 +322,13 @@ module.exports = { ], }, }, + { + files: [ 'packages/components/src/**/*.[tj]s?(x)' ], + excludedFiles: [ ...developmentFiles ], + rules: { + 'react-hooks/exhaustive-deps': 'error', + }, + }, { files: [ 'packages/jest*/**/*.js', '**/test/**/*.js' ], excludedFiles: [ 'test/e2e/**/*.js' ], diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 11bae78e235e2..fe144c59ec1bb 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -28,6 +28,7 @@ - `Draggable`: Convert to TypeScript ([#45471](https://github.com/WordPress/gutenberg/pull/45471)). - `MenuGroup`: Convert to TypeScript ([#45617](https://github.com/WordPress/gutenberg/pull/45617)). - `useCx`: fix story to satisfy the `react-hooks/exhaustive-deps` eslint rule ([#45614](https://github.com/WordPress/gutenberg/pull/45614)) +- Activate the `react-hooks/exhuastive-deps` eslint rule for the Components package ([#41166](https://github.com/WordPress/gutenberg/pull/41166)) ### Experimental