diff --git a/.eslintrc-code-compatibility.js b/.eslintrc-code-compatibility.js index 7f19396f34..92080c6c42 100644 --- a/.eslintrc-code-compatibility.js +++ b/.eslintrc-code-compatibility.js @@ -1,6 +1,6 @@ module.exports = { root: true, - extends: ['plugin:compat/recommended', 'plugin:ecmalist/recommended'], + extends: ['plugin:compat/recommended', 'plugin:ecmalist/recommended', 'plugin:react-hooks/recommended'], settings: { es: { aggressive: true } }, env: { browser: true, mocha: true }, parser: '@babel/eslint-parser', diff --git a/libs/blocks/caas-config/caas-config.js b/libs/blocks/caas-config/caas-config.js index 7471becc2e..90263caaea 100644 --- a/libs/blocks/caas-config/caas-config.js +++ b/libs/blocks/caas-config/caas-config.js @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/exhaustive-deps */ /* global ClipboardItem */ import { createContext, @@ -564,7 +565,7 @@ const FilterPanel = ({ tagsData }) => { <${TagSelect} id="customFilterTag" options=${allTags} label="Filter Tag" singleSelect /> - + <${FormInput} label="Opened on load" name="openedOnLoad" type="checkbox" /> `; @@ -739,8 +740,10 @@ const CopyBtn = () => { }; const getUrl = () => { - const url = window.location.href.split('#')[0]; - return `${url}#${utf8ToB64(JSON.stringify(state, fgKeyReplacer))}`; + const url = new URL(window.location.href); + url.search = ''; + url.hash = utf8ToB64(JSON.stringify(state, fgKeyReplacer)); + return url.href; }; const copyConfig = () => { @@ -893,7 +896,8 @@ const Configurator = ({ rootEl }) => { setIsCaasLoaded(true); }) .catch((e) => { - /* c8 ignore next */ + /* c8 ignore next 2 */ + // eslint-disable-next-line no-console console.log('Error loading script: ', e); }); }, []); diff --git a/libs/blocks/caas/caas.css b/libs/blocks/caas/caas.css index 245f60c453..7381328d0c 100644 --- a/libs/blocks/caas/caas.css +++ b/libs/blocks/caas/caas.css @@ -1,4 +1,4 @@ -a[href*='/tools/caas#'] { +a[href*='/tools/caas#'], a[href*='/tools/caas?'] { visibility: hidden !important; } diff --git a/libs/blocks/faas-config/faas-config.js b/libs/blocks/faas-config/faas-config.js index f93e54bf1c..efe0fe4616 100644 --- a/libs/blocks/faas-config/faas-config.js +++ b/libs/blocks/faas-config/faas-config.js @@ -285,6 +285,7 @@ const RequiredPanel = () => { }; if (!Object.keys(langOptions).length) { + // eslint-disable-next-line react-hooks/rules-of-hooks useEffect(() => { getObjFromAPI('/faas/api/locale').then((data) => { data.forEach((l) => { diff --git a/libs/hooks/useHover.js b/libs/hooks/useHover.js index 0dcc09ced5..44bfe0d0fe 100644 --- a/libs/hooks/useHover.js +++ b/libs/hooks/useHover.js @@ -14,6 +14,7 @@ import { useEffect, useState, useRef } from '../deps/htm-preact.js'; const useHover = ({ refToAttachTo = null, useMouseLeave = false } = {}) => { const [hoverState, setHoverState] = useState(false); + // eslint-disable-next-line react-hooks/rules-of-hooks const ref = refToAttachTo || useRef(null); const handleMouseOver = (ev) => setHoverState({ hovering: true, event: ev });