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

Eslint plugin react hooks #75

Merged
merged 4 commits into from Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions eslintrc.json
Expand Up @@ -14,7 +14,8 @@
},

"plugins": [
"react"
"react",
"react-hooks"
],

"rules": {
Expand All @@ -27,6 +28,8 @@
"react/no-unknown-property": "error",
"react/no-unused-prop-types": "error",
"react/prop-types": "error",
"react/react-in-jsx-scope": "error"
"react/react-in-jsx-scope": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error"
Copy link
Member

@LinusU LinusU Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that exhaustive-deps could result in a lot of errors for many project, potentially it would be better to first release this as warning and then switch to error in the major version after that.

(that is how no-var was rolled out: standard/standard#1586)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good ! For some reason I thought the policy for standard eslint rules was no warnings, only errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done @LinusU

}
}
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -48,7 +48,8 @@
"main": "index.js",
"peerDependencies": {
"eslint": "^8.8.0",
"eslint-plugin-react": "^7.28.0"
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.6.0"
},
"repository": {
"type": "git",
Expand Down