diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts index af63c4ad2..d2525b6e9 100644 --- a/packages/integrations/mdx/src/index.ts +++ b/packages/integrations/mdx/src/index.ts @@ -10,11 +10,14 @@ type WithExtends = T | { extends: T }; type MdxOptions = { remarkPlugins?: WithExtends; rehypePlugins?: WithExtends; -} +}; const DEFAULT_REMARK_PLUGINS = [remarkGfm, remarkSmartypants]; -function handleExtends(config: WithExtends, defaults: T[] = []): T[] | undefined { +function handleExtends( + config: WithExtends, + defaults: T[] = [] +): T[] | undefined { if (Array.isArray(config)) return config; return [...defaults, ...(config?.extends ?? [])]; diff --git a/packages/integrations/mdx/test/mdx-remark-plugins.test.js b/packages/integrations/mdx/test/mdx-remark-plugins.test.js index 545df3174..dad976989 100644 --- a/packages/integrations/mdx/test/mdx-remark-plugins.test.js +++ b/packages/integrations/mdx/test/mdx-remark-plugins.test.js @@ -11,9 +11,11 @@ describe('MDX remark plugins', () => { it('supports custom remark plugins - TOC', async () => { const fixture = await loadFixture({ root: FIXTURE_ROOT, - integrations: [mdx({ - remarkPlugins: [remarkToc], - })], + integrations: [ + mdx({ + remarkPlugins: [remarkToc], + }), + ], }); await fixture.build(); @@ -41,9 +43,11 @@ describe('MDX remark plugins', () => { it('preserves default GitHub-flavored markdown with "extends"', async () => { const fixture = await loadFixture({ root: FIXTURE_ROOT, - integrations: [mdx({ - remarkPlugins: { extends: [remarkToc] }, - })], + integrations: [ + mdx({ + remarkPlugins: { extends: [remarkToc] }, + }), + ], }); await fixture.build();