1
0
Fork 0

wip(shared): Brokering peace between prettier and eslint

This commit is contained in:
Joost De Cock 2022-12-26 17:58:00 +01:00
parent ba76fdc2a7
commit dfa26c2e35
2 changed files with 10 additions and 4 deletions

View file

@ -21,9 +21,12 @@ const MdxWrapper = ({ mdx, app, t, components = {} }) => {
const [mdxModule, setMdxModule] = useState() const [mdxModule, setMdxModule] = useState()
useEffect(() => { useEffect(() => {
;(async () => { // This is a workaround to keep prettier and eslint
// from fighting over syntax
async function prettierEslintPeaceDeal() {
setMdxModule(await run(mdx, runtime)) setMdxModule(await run(mdx, runtime))
})() }
prettierEslintPeaceDeal()
}, [mdx]) }, [mdx])
/* /*

View file

@ -13,9 +13,12 @@ const TocWrapper = ({ toc }) => {
const [mdxModule, setMdxModule] = useState() const [mdxModule, setMdxModule] = useState()
useEffect(() => { useEffect(() => {
;(async () => { // This is a workaround to keep prettier and eslint
// from fighting over syntax
async function prettierEslintPeaceDeal() {
setMdxModule(await run(toc, runtime)) setMdxModule(await run(toc, runtime))
})() }
prettierEslintPeaceDeal()
}, [toc]) }, [toc])
// React component for MDX content // React component for MDX content