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

chore(eslint): enable react-hooks/recommended #4498

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"root": true,
"parser": "babel-eslint",
"extends": ["airbnb", "prettier"],
"extends": ["airbnb", "prettier", "plugin:react-hooks/recommended"],
"env": {
"browser": true
},
Expand Down
3 changes: 3 additions & 0 deletions src/modules/Accordion/AccordionAccordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ const AccordionAccordion = React.forwardRef(function (props, ref) {
})

if (process.env.NODE_ENV !== 'production') {
// Following eslint error is ignored because process.env.NODE_ENV does not change during runtime,
// so it is not actually a problem because the useEffect will be called either always or never
// eslint-disable-next-line react-hooks/rules-of-hooks
React.useEffect(() => {
/* eslint-disable no-console */
if (exclusive && typeof activeIndex !== 'number') {
Expand Down
Loading