diff --git a/.eslintrc b/.eslintrc index cae9985dda..da85b88782 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,7 @@ { "root": true, "parser": "babel-eslint", - "extends": ["airbnb", "prettier"], + "extends": ["airbnb", "prettier", "plugin:react-hooks/recommended"], "env": { "browser": true }, diff --git a/src/modules/Accordion/AccordionAccordion.js b/src/modules/Accordion/AccordionAccordion.js index f99285ee5d..6dfc5fd86b 100644 --- a/src/modules/Accordion/AccordionAccordion.js +++ b/src/modules/Accordion/AccordionAccordion.js @@ -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') {