ESLint plugin that adds the rule 'no-unused-deps' to detect unused dependencies in React Hook dependency arrays, complementing eslint-plugin-react-hooks. Current stable version is 0.5.1, released with support for ESLint v10. It flags variables in dependency arrays that are declared but not referenced inside the hook body, helping prevent unintended effect executions. Key differentiators: built-in support for static effect detection (unused deps), optional comment directive to mark intentional effect dependencies, and the ability to extend checking to custom hooks via `additionalHooks` option. It ships TypeScript types and provides both flat and legacy config.
npm install eslint-plugin-react-hooks-addonsVerified import paths — ran on the pinned version, not inferred.
Installation, both flat and legacy config setup, and a React component demonstrating the rule.
Add 'additionalHooks' pattern in rule options to match custom hooks.
Use 'import reactHooksAddons from 'eslint-plugin-react-hooks-addons''.
Rename option 'customComment' to 'effectComment'.
Use 'extends: ["plugin:react-hooks-addons/recommended-legacy"]'.
Install both plugins: eslint-plugin-react-hooks and eslint-plugin-react-hooks-addons.
Run 'npm install -D eslint-plugin-react-hooks-addons'
Change option name from 'customComment' to 'effectComment'.
Use require() for CommonJS or set up a build step for ESM.