Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

React wrong lint error when checking hooks (due to outdated hooks lint package) [manually upgraded lint versions] #3742

Closed
zaunermax opened this issue Sep 16, 2020 · 5 comments
Labels
blocked: retry with latest Retry with latest release or head. outdated scope: react Issues related to React support for Nx type: bug

Comments

@zaunermax
Copy link

zaunermax commented Sep 16, 2020

Current Behavior

Now I understand, that officially nx did not yet upgrade the lint version, but I just tried it out anyways and it seems to work fine by just manually upgrading the versions in the package json (more infos on the changed versions in the section below).

This issue is meant as kind of a heads up if the maintainers decide to upgrade the lint versions in the future 🙌 If you think this is too early, you can close this right away.

So anyways, there is a wrong React hooks lint error. There is already a merged PR on their repo: facebook/react#19751

Updating the dependency eslint-plugin-react-hooks in the package @nrwl/react to at least 4.1.1 would fix the issue.

Expected Behavior

hooks with generic parameters should be linted correctly

Steps to Reproduce

Create a react app/lib with nx, update all eslint versions manually, create a custom react hook and use generics in it.

Environment

nx : Not Found
@nrwl/angular : Not Found
@nrwl/cli : 10.2.0
@nrwl/cypress : 10.2.0
@nrwl/eslint-plugin-nx : 10.2.0
@nrwl/express : Not Found
@nrwl/jest : 10.2.0
@nrwl/linter : 10.2.0
@nrwl/nest : 10.2.0
@nrwl/next : Not Found
@nrwl/node : 10.2.0
@nrwl/react : 10.2.0
@nrwl/schematics : Not Found
@nrwl/tao : 10.2.0
@nrwl/web : 10.2.0
@nrwl/workspace : 10.2.0
typescript : 4.0.2

manually updated eslint versions:

"@nrwl/eslint-plugin-nx": "10.2.0",
"@typescript-eslint/eslint-plugin": "4.1.1",
"@typescript-eslint/parser": "4.1.1",
"eslint": "7.9.0",
"eslint-config-prettier": "6.11.0",
@zaunermax zaunermax changed the title React wrong lint error when checking hooks (due to outdated hooks lint package) React wrong lint error when checking hooks (due to outdated hooks lint package) [manually upgraded lint versions] Sep 16, 2020
@FrozenPandaz FrozenPandaz added the scope: react Issues related to React support for Nx label Sep 18, 2020
@zaunermax
Copy link
Author

Just a heads up: after the 10.3.1 update (which updates to ts 4 and also upgrades other lint packages) this is still an isse.

So now i have no more manually upgraded packages, just nx:

nx : Not Found
@nrwl/angular : Not Found
@nrwl/cli : 10.3.1
@nrwl/cypress : 10.3.1
@nrwl/eslint-plugin-nx : 10.3.1
@nrwl/express : Not Found
@nrwl/jest : 10.3.1
@nrwl/linter : 10.3.1
@nrwl/nest : 10.3.1
@nrwl/next : Not Found
@nrwl/node : 10.3.1
@nrwl/react : 10.3.1
@nrwl/schematics : Not Found
@nrwl/tao : 10.3.1
@nrwl/web : 10.3.1
@nrwl/workspace : 10.3.1
typescript : 4.0.3

@kirjai
Copy link
Contributor

kirjai commented Mar 25, 2021

Looking at the dependencies now, Nx is on latest version of eslint-plugin-react-hooks - 4.2.0. I believe this issue is now resolved

@kirjai kirjai added the blocked: retry with latest Retry with latest release or head. label Mar 25, 2021
@zaunermax
Copy link
Author

I'll have a look tomorrow @ work and I will let you know!

@zaunermax
Copy link
Author

Seems to be fixed now 🙌

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
blocked: retry with latest Retry with latest release or head. outdated scope: react Issues related to React support for Nx type: bug
Projects
None yet
Development

No branches or pull requests

3 participants