From dfa26c2e35a55b189fbb13563ac2c7f4d152bb55 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Mon, 26 Dec 2022 17:58:00 +0100 Subject: [PATCH] wip(shared): Brokering peace between prettier and eslint --- sites/shared/components/wrappers/mdx.js | 7 +++++-- sites/shared/components/wrappers/toc.js | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sites/shared/components/wrappers/mdx.js b/sites/shared/components/wrappers/mdx.js index b5670a1d0b0..1c1ab3a64db 100644 --- a/sites/shared/components/wrappers/mdx.js +++ b/sites/shared/components/wrappers/mdx.js @@ -21,9 +21,12 @@ const MdxWrapper = ({ mdx, app, t, components = {} }) => { const [mdxModule, setMdxModule] = useState() useEffect(() => { - ;(async () => { + // This is a workaround to keep prettier and eslint + // from fighting over syntax + async function prettierEslintPeaceDeal() { setMdxModule(await run(mdx, runtime)) - })() + } + prettierEslintPeaceDeal() }, [mdx]) /* diff --git a/sites/shared/components/wrappers/toc.js b/sites/shared/components/wrappers/toc.js index 39dfe874577..4fa9918875d 100644 --- a/sites/shared/components/wrappers/toc.js +++ b/sites/shared/components/wrappers/toc.js @@ -13,9 +13,12 @@ const TocWrapper = ({ toc }) => { const [mdxModule, setMdxModule] = useState() useEffect(() => { - ;(async () => { + // This is a workaround to keep prettier and eslint + // from fighting over syntax + async function prettierEslintPeaceDeal() { setMdxModule(await run(toc, runtime)) - })() + } + prettierEslintPeaceDeal() }, [toc]) // React component for MDX content