summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bholmesdev <bholmesdev@users.noreply.github.com> 2022-08-30 17:41:06 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2022-08-30 17:41:06 +0000
commit385a8f052f15972380bda081edbb6855de106985 (patch)
treee66a712898b1941a28f66ce0f068753f65317836
parent8f8dff4d339a3a12ee155d81a97132032ef3b622 (diff)
downloadastro-385a8f052f15972380bda081edbb6855de106985.tar.gz
astro-385a8f052f15972380bda081edbb6855de106985.tar.zst
astro-385a8f052f15972380bda081edbb6855de106985.zip
[ci] format
Diffstat (limited to '')
-rw-r--r--packages/integrations/mdx/src/index.ts8
-rw-r--r--packages/integrations/mdx/src/utils.ts12
-rw-r--r--packages/integrations/mdx/test/mdx-plugins.test.js12
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);