From 385a8f052f15972380bda081edbb6855de106985 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Tue, 30 Aug 2022 17:41:06 +0000 Subject: [PATCH] [ci] format --- packages/integrations/mdx/src/index.ts | 8 ++++---- packages/integrations/mdx/src/utils.ts | 12 ++++++------ packages/integrations/mdx/test/mdx-plugins.test.js | 12 +++--------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts index 0a2ddc8d3..571fecb67 100644 --- a/packages/integrations/mdx/src/index.ts +++ b/packages/integrations/mdx/src/index.ts @@ -2,18 +2,18 @@ import { compile as mdxCompile } from '@mdx-js/mdx'; import mdxPlugin, { Options as MdxRollupPluginOptions } from '@mdx-js/rollup'; import type { AstroIntegration } from 'astro'; import { parse as parseESM } from 'es-module-lexer'; +import { blue, bold } from 'kleur/colors'; import { VFile } from 'vfile'; import type { Plugin as VitePlugin } from 'vite'; -import { bold, blue } from 'kleur/colors'; import { rehypeApplyFrontmatterExport } from './astro-data-utils.js'; +import type { MdxOptions } from './utils.js'; import { getFileInfo, - parseFrontmatter, - handleExtendsNotSupported, getRehypePlugins, getRemarkPlugins, + handleExtendsNotSupported, + parseFrontmatter, } from './utils.js'; -import type { MdxOptions } from './utils.js'; const RAW_CONTENT_ERROR = 'MDX does not support rawContent()! If you need to read the Markdown contents to calculate values (ex. reading time), we suggest injecting frontmatter via remark plugins. Learn more on our docs: https://docs.astro.build/en/guides/integrations-guide/mdx/#inject-frontmatter-via-remark-or-rehype-plugins'; diff --git a/packages/integrations/mdx/src/utils.ts b/packages/integrations/mdx/src/utils.ts index dc7879dd8..174cad9c1 100644 --- a/packages/integrations/mdx/src/utils.ts +++ b/packages/integrations/mdx/src/utils.ts @@ -1,11 +1,12 @@ -import type { Options as AcornOpts } from 'acorn'; -import type { AstroConfig, SSRError } from 'astro'; -import type { MdxjsEsm } from 'mdast-util-mdx'; +import { nodeTypes } from '@mdx-js/mdx'; import type { PluggableList } from '@mdx-js/mdx/lib/core.js'; import type { Options as MdxRollupPluginOptions } from '@mdx-js/rollup'; -import { bold, yellow } from 'kleur/colors'; -import { nodeTypes } from '@mdx-js/mdx'; +import type { Options as AcornOpts } from 'acorn'; import { parse } from 'acorn'; +import type { AstroConfig, SSRError } from 'astro'; +import matter from 'gray-matter'; +import { bold, yellow } from 'kleur/colors'; +import type { MdxjsEsm } from 'mdast-util-mdx'; import rehypeRaw from 'rehype-raw'; import remarkGfm from 'remark-gfm'; import remarkSmartypants from 'remark-smartypants'; @@ -13,7 +14,6 @@ import { remarkInitializeAstroData } from './astro-data-utils.js'; import rehypeCollectHeadings from './rehype-collect-headings.js'; import remarkPrism from './remark-prism.js'; import remarkShiki from './remark-shiki.js'; -import matter from 'gray-matter'; export type MdxOptions = { remarkPlugins?: PluggableList; diff --git a/packages/integrations/mdx/test/mdx-plugins.test.js b/packages/integrations/mdx/test/mdx-plugins.test.js index 45f69116d..a5c9480ae 100644 --- a/packages/integrations/mdx/test/mdx-plugins.test.js +++ b/packages/integrations/mdx/test/mdx-plugins.test.js @@ -44,9 +44,7 @@ describe('MDX plugins', () => { remarkPlugins: [remarkExamplePlugin], rehypePlugins: [rehypeExamplePlugin], }, - integrations: [ - mdx(), - ], + integrations: [mdx()], }); const html = await fixture.readFile(FILE); @@ -61,9 +59,7 @@ describe('MDX plugins', () => { markdown: { remarkPlugins: [['remark-toc']], }, - integrations: [ - mdx(), - ], + integrations: [mdx()], }); const html = await fixture.readFile(FILE); @@ -79,9 +75,7 @@ describe('MDX plugins', () => { rehypePlugins: [rehypeExamplePlugin], extendDefaultPlugins: true, }, - integrations: [ - mdx(), - ], + integrations: [mdx()], }); const html = await fixture.readFile(FILE);