Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

react hooks rules #6

Open
diegohmac opened this issue Mar 5, 2023 · 2 comments
Open

react hooks rules #6

diegohmac opened this issue Mar 5, 2023 · 2 comments

Comments

@diegohmac
Copy link

diegohmac commented Mar 5, 2023

I created a project from scratch with Vite + Typescript and I've added the eslint-config-rocketseat to it.

It's working fine for everything but the react hooks rules.

For example, I have a useEffect without declaring its dependencies and it's not throwing any red lines there.

Is there an additional config that I need to make in order to have it working?

This is my .eslintrc.json

{
  "extends": ["@rocketseat/eslint-config/react"]
}
@brunoocastro
Copy link

I found this trouble too, have you an solution ?

@teosoares10
Copy link

You need to install eslint-plugin-react-hooks
npm i eslint-plugin-react-hooks -D

yarn add eslint-plugin-react-hooks -D

pnpm i eslint-plugin-react-hooks -D

Inside .eslintrc.json

{
   "settings": {
        "react": {
            "version": "detect"
         }
   }
},
{
  "extends": "plugin:react-hooks/recommended"
}

I hope this is helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants