You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Rules with suggestions must set the meta.hasSuggestions property to true #22545
I'm basically running into an issue where eslint is asking me to set meta.hasSuggestions to true. When I use "react-hooks/exhaustive-deps": "error". Is there something I'm doing wrong or is this a dep version thing?
If I try to remove the react-hook plugin and extension this happens: Definition for rule 'react-hooks/exhaustive-deps' was not found
Link to code example:
The current behavior
The expected behavior
Reacted by Lucas Caton, Guillaume AMAT, Moritz Mahringer, April Mintac Pineda, Xavier Fournet, Derek Sifford, itsMapleLeaf, Wojciech Wnętrzak, Chaitanya K Kamatham, Martin Landälv and 41 more
Keeping this open for visibility. We've had similar reports before and open issues have better visibility.
Reacted by Xun Sun, Antoine Rousseau, Aleksei Smoliakov, Vladlen Popelenkov, jp7837, Marco Arnold, Bálint Mérő, Léo Chéron, Qingqi Shi, Lucas Caton and 40 more
Reacted by pkelly-rh and isobe-h
Reacted by Andrey Gubanov, Hassen Chaieb, Yony and Eddy Jeon
Running npm install eslint-plugin-react-hooks@next worked for me
Reacted by Saran Tanpituckpong ✔️, Goksel Eryigit, a-tonchev, Aleksei Smoliakov, Nicu Barbaros, Xun Sun, Esra, Max Onyshchenko, Jameson Gamble, Ashley MacWhirter and 2 more
Reacted by Saran Tanpituckpong ✔️, kik4, Sebastian "Sebbie" Silbermann, ara-ta3, 李國均, Rich Cooper, Luis Gustavo Bier Schüler, Cameron Braid and Costa Alexoglou
Activity
pkelly-rh commentedon Oct 12, 2021
Straight from the horses mouth.
This fixed it helped me fix it: https://lifesaver.codes/answer/eslint-feedback-for-exhaustive-deps-lint-rule
Install:
npm install eslint-plugin-react-hooks@nextAnd changed the eslint config to:
{ "env": { "browser": true, "es2021": true }, "extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "prettier" ], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { "jsx": true }, "ecmaVersion": 13, "sourceType": "module" }, "plugins": ["react", "react-hooks", "@typescript-eslint"], "rules": { "react-hooks/exhaustive-deps": "error", }, "settings": { "react": { "version": "detect" } } }@gaearon why didn't this just work out of the box?
mcrawshaw commentedon Oct 12, 2021
There was just a major version release of eslint (with breaking changes), so a few dep packages are still catching up.
eps1lon commentedon Oct 13, 2021
Fixed in #22248 which hasn't been released yet.
Keeping this open for visibility. We've had similar reports before and open issues have better visibility.
fix: react-hooks broken in eslint 8.x
caribou-code commentedon Oct 25, 2021
Is there a release date for this yet? Looks like the fix was merged on 6 Sept.
Bessonov commentedon Oct 27, 2021
@caribou-code yeah, it's pity, but you can get the next version with the fix through your package manager:
geekftz commentedon Oct 28, 2021
try to install "eslint-plugin-react-hooks@next" can resolve the question.
pkelly-rh commentedon Oct 28, 2021
Running
npm install eslint-plugin-react-hooks@nextworked for mepaul-mesnilgrente commentedon Nov 4, 2021
Looks like we're still waiting on a new release. Is there any ETA?
I'm going to move to
eslint-plugin-react-hooks@nextfor now.a-tonchev commentedon Nov 4, 2021
This works for me, thanks!
Dangoo commentedon Nov 10, 2021
Looks like
v4.3was just released some hours ago which should ship ESLint 8 support:https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md#430
See as well #22248