this is what i did:
pnpm install eslint-plugin-react-hooks --save-dev
//.eslintrc.cjs file
module.exports = {
env: {
browser: true,
es2021: true,
},
// only these 2 lines need to be changed
extends: ['airbnb', 'plugin:react-hooks/recommended'],
plugins: ['react-hooks'],
}
// the above 'plugin:react-hooks/recommended' setting essentially adds these 2 lines so you dont have to manually add them in the rules section
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
saw from a video where linting for react-hooks was used and looked it up react documentation has recommended linting: https://react.dev/learn/editor-setup#linting
this is what i did:
pnpm install eslint-plugin-react-hooks --save-dev