From c15e7ebc5e92be06a2406bed562d7c24367dc6e7 Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Wed, 8 Jun 2022 17:43:10 +0000 Subject: [PATCH] [ci] format --- packages/markdown/remark/src/mdxjs.ts | 16 ++-- packages/markdown/remark/src/remark-mdxish.ts | 2 +- .../markdown/remark/test/strictness.test.js | 75 +++++-------------- 3 files changed, 24 insertions(+), 69 deletions(-) diff --git a/packages/markdown/remark/src/mdxjs.ts b/packages/markdown/remark/src/mdxjs.ts index b00c3eb80..c3a9849ea 100644 --- a/packages/markdown/remark/src/mdxjs.ts +++ b/packages/markdown/remark/src/mdxjs.ts @@ -4,13 +4,13 @@ // See `@astrojs/micromark-extension-mdx-jsx` on NPM for more details. // Also, support for ESM imports & exports in Markdown content was removed. +import { mdxJsx } from '@astrojs/micromark-extension-mdx-jsx'; import { Parser } from 'acorn'; import acornJsx from 'acorn-jsx'; -import { combineExtensions } from 'micromark-util-combine-extensions'; -import { mdxExpression } from 'micromark-extension-mdx-expression'; -import { mdxJsx } from '@astrojs/micromark-extension-mdx-jsx'; -import { mdxMd } from 'micromark-extension-mdx-md'; import type { Options } from 'micromark-extension-mdx-expression'; +import { mdxExpression } from 'micromark-extension-mdx-expression'; +import { mdxMd } from 'micromark-extension-mdx-md'; +import { combineExtensions } from 'micromark-util-combine-extensions'; import type { Extension } from 'micromark-util-types'; export function mdxjs(options: Options): Extension { @@ -18,14 +18,10 @@ export function mdxjs(options: Options): Extension { { acorn: Parser.extend(acornJsx()), acornOptions: { ecmaVersion: 2020, sourceType: 'module' }, - addResult: true + addResult: true, }, options ); - return combineExtensions([ - mdxExpression(settings), - mdxJsx(settings), - mdxMd - ]); + return combineExtensions([mdxExpression(settings), mdxJsx(settings), mdxMd]); } diff --git a/packages/markdown/remark/src/remark-mdxish.ts b/packages/markdown/remark/src/remark-mdxish.ts index 7911f5ec9..50bf5f103 100644 --- a/packages/markdown/remark/src/remark-mdxish.ts +++ b/packages/markdown/remark/src/remark-mdxish.ts @@ -1,7 +1,7 @@ import type * as fromMarkdown from 'mdast-util-from-markdown'; import type { Tag } from 'mdast-util-mdx-jsx'; -import { mdxjs } from './mdxjs.js'; import { mdxFromMarkdown, mdxToMarkdown } from './mdast-util-mdxish.js'; +import { mdxjs } from './mdxjs.js'; export default function remarkMdxish(this: any, options = {}) { const data = this.data(); diff --git a/packages/markdown/remark/test/strictness.test.js b/packages/markdown/remark/test/strictness.test.js index 178d48f74..5ba9c215a 100644 --- a/packages/markdown/remark/test/strictness.test.js +++ b/packages/markdown/remark/test/strictness.test.js @@ -17,36 +17,21 @@ describe('strictness', () => { }); it('should allow attribute names starting with ":" after element names', async () => { - const { code } = await renderMarkdown( - `
Test
`, - {} - ); + const { code } = await renderMarkdown(`
Test
`, {}); - chai - .expect(code.trim()) - .to.equal(`
Test
`); + chai.expect(code.trim()).to.equal(`
Test
`); }); it('should allow attribute names starting with ":" after local element names', async () => { - const { code } = await renderMarkdown( - `x`, - {} - ); + const { code } = await renderMarkdown(`x`, {}); - chai - .expect(code.trim()) - .to.equal(`x`); + chai.expect(code.trim()).to.equal(`x`); }); it('should allow attribute names starting with ":" after attribute names', async () => { - const { code } = await renderMarkdown( - ``, - {} - ); + const { code } = await renderMarkdown(``, {}); - chai - .expect(code.trim()) - .to.equal(``); + chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with ":" after local attribute names', async () => { @@ -55,31 +40,19 @@ describe('strictness', () => { {} ); - chai - .expect(code.trim()) - .to.equal(``); + chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with ":" after attribute values', async () => { - const { code } = await renderMarkdown( - ``, - {} - ); + const { code } = await renderMarkdown(``, {}); - chai - .expect(code.trim()) - .to.equal(``); + chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with "@" after element names', async () => { - const { code } = await renderMarkdown( - ``, - {} - ); + const { code } = await renderMarkdown(``, {}); - chai - .expect(code.trim()) - .to.equal(``); + chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with "@" after local element names', async () => { @@ -88,9 +61,7 @@ describe('strictness', () => { {} ); - chai - .expect(code.trim()) - .to.equal(`Test`); + chai.expect(code.trim()).to.equal(`Test`); }); it('should allow attribute names starting with "@" after attribute names', async () => { @@ -99,9 +70,7 @@ describe('strictness', () => { {} ); - chai - .expect(code.trim()) - .to.equal(``); + chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with "@" after local attribute names', async () => { @@ -110,9 +79,7 @@ describe('strictness', () => { {} ); - chai - .expect(code.trim()) - .to.equal(``); + chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with "@" after attribute values', async () => { @@ -121,20 +88,12 @@ describe('strictness', () => { {} ); - chai - .expect(code.trim()) - .to.equal(``); + chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names containing dots', async () => { - const { code } = await renderMarkdown( - ``, - {} - ); + const { code } = await renderMarkdown(``, {}); - chai - .expect(code.trim()) - .to.equal(``); + chai.expect(code.trim()).to.equal(``); }); - });