0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

[ci] format

This commit is contained in:
bholmesdev 2022-08-30 17:41:06 +00:00 committed by fredkbot
parent 8f8dff4d33
commit 385a8f052f
3 changed files with 13 additions and 19 deletions

View file

@ -2,18 +2,18 @@ import { compile as mdxCompile } from '@mdx-js/mdx';
import mdxPlugin, { Options as MdxRollupPluginOptions } from '@mdx-js/rollup'; import mdxPlugin, { Options as MdxRollupPluginOptions } from '@mdx-js/rollup';
import type { AstroIntegration } from 'astro'; import type { AstroIntegration } from 'astro';
import { parse as parseESM } from 'es-module-lexer'; import { parse as parseESM } from 'es-module-lexer';
import { blue, bold } from 'kleur/colors';
import { VFile } from 'vfile'; import { VFile } from 'vfile';
import type { Plugin as VitePlugin } from 'vite'; import type { Plugin as VitePlugin } from 'vite';
import { bold, blue } from 'kleur/colors';
import { rehypeApplyFrontmatterExport } from './astro-data-utils.js'; import { rehypeApplyFrontmatterExport } from './astro-data-utils.js';
import type { MdxOptions } from './utils.js';
import { import {
getFileInfo, getFileInfo,
parseFrontmatter,
handleExtendsNotSupported,
getRehypePlugins, getRehypePlugins,
getRemarkPlugins, getRemarkPlugins,
handleExtendsNotSupported,
parseFrontmatter,
} from './utils.js'; } from './utils.js';
import type { MdxOptions } from './utils.js';
const RAW_CONTENT_ERROR = 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'; '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';

View file

@ -1,11 +1,12 @@
import type { Options as AcornOpts } from 'acorn'; import { nodeTypes } from '@mdx-js/mdx';
import type { AstroConfig, SSRError } from 'astro';
import type { MdxjsEsm } from 'mdast-util-mdx';
import type { PluggableList } from '@mdx-js/mdx/lib/core.js'; import type { PluggableList } from '@mdx-js/mdx/lib/core.js';
import type { Options as MdxRollupPluginOptions } from '@mdx-js/rollup'; import type { Options as MdxRollupPluginOptions } from '@mdx-js/rollup';
import { bold, yellow } from 'kleur/colors'; import type { Options as AcornOpts } from 'acorn';
import { nodeTypes } from '@mdx-js/mdx';
import { parse } 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 rehypeRaw from 'rehype-raw';
import remarkGfm from 'remark-gfm'; import remarkGfm from 'remark-gfm';
import remarkSmartypants from 'remark-smartypants'; import remarkSmartypants from 'remark-smartypants';
@ -13,7 +14,6 @@ import { remarkInitializeAstroData } from './astro-data-utils.js';
import rehypeCollectHeadings from './rehype-collect-headings.js'; import rehypeCollectHeadings from './rehype-collect-headings.js';
import remarkPrism from './remark-prism.js'; import remarkPrism from './remark-prism.js';
import remarkShiki from './remark-shiki.js'; import remarkShiki from './remark-shiki.js';
import matter from 'gray-matter';
export type MdxOptions = { export type MdxOptions = {
remarkPlugins?: PluggableList; remarkPlugins?: PluggableList;

View file

@ -44,9 +44,7 @@ describe('MDX plugins', () => {
remarkPlugins: [remarkExamplePlugin], remarkPlugins: [remarkExamplePlugin],
rehypePlugins: [rehypeExamplePlugin], rehypePlugins: [rehypeExamplePlugin],
}, },
integrations: [ integrations: [mdx()],
mdx(),
],
}); });
const html = await fixture.readFile(FILE); const html = await fixture.readFile(FILE);
@ -61,9 +59,7 @@ describe('MDX plugins', () => {
markdown: { markdown: {
remarkPlugins: [['remark-toc']], remarkPlugins: [['remark-toc']],
}, },
integrations: [ integrations: [mdx()],
mdx(),
],
}); });
const html = await fixture.readFile(FILE); const html = await fixture.readFile(FILE);
@ -79,9 +75,7 @@ describe('MDX plugins', () => {
rehypePlugins: [rehypeExamplePlugin], rehypePlugins: [rehypeExamplePlugin],
extendDefaultPlugins: true, extendDefaultPlugins: true,
}, },
integrations: [ integrations: [mdx()],
mdx(),
],
}); });
const html = await fixture.readFile(FILE); const html = await fixture.readFile(FILE);