From f7125de422880c448f1c4c58ef0df52b5e74b154 Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Fri, 15 Sep 2023 16:22:31 +0100 Subject: [PATCH] test: disable react-hooks/exhaustive-deps linting There are many times it is necessary to exclude values from the hook dependencies. Rather than littering the codebase with exceptions, we can just disable it globally. --- .eslintrc.js | 3 +++ packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5b999efa47..ec9a3ac937 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,4 +7,7 @@ module.exports = { rootDir: ["apps/*/"], }, }, + rules: { + "react-hooks/exhaustive-deps": "off", + }, }; diff --git a/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx b/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx index 9586e3b5be..b0cb2601f5 100644 --- a/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx +++ b/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx @@ -109,8 +109,6 @@ const HeadingOutlineAnalyer = ({ } else { setHierarchy(buildHierarchy()); } - - // eslint-disable-next-line react-hooks/exhaustive-deps }, [data.content]); return (