[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 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';

View file

@ -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;

View file

@ -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);