Skip to content

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

Closed
@zaunermax

Description

@zaunermax

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",

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions