Skip to content

Commit

Permalink
Refactor code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 14, 2022
1 parent 5cb07ab commit fa9c42a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/guides/frontmatter.server.mdx
Expand Up @@ -47,7 +47,7 @@ title: Hi, World!
Then without compiling or evaluating the metadata can be accessed like so:

```js path="example.js"
import {promises as fs} from 'node:fs'
import fs from 'node:fs/promises'
import yaml from 'js-yaml'

console.log(yaml.loadAll(await fs.readFile('post.mdx'))[0])
Expand All @@ -59,7 +59,7 @@ it can be enabled by using a remark plugin,
[`remark-frontmatter`][remark-frontmatter]:

```js path="example.js"
import {promises as fs} from 'node:fs'
import fs from 'node:fs/promises'
import remarkFrontmatter from 'remark-frontmatter'
import {compile} from '@mdx-js/mdx'

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/gfm.server.mdx
Expand Up @@ -51,7 +51,7 @@ A note[^1]
The above MDX with GFM can be transformed with the following module:

```js path="example.js"
import {promises as fs} from 'node:fs'
import fs from 'node:fs/promises'
import {compile} from '@mdx-js/mdx'
import remarkGfm from 'remark-gfm'

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/math.server.mdx
Expand Up @@ -31,7 +31,7 @@ Say we have an MDX file like this:
The above MDX with math can be transformed with the following module:

```js path="example.js"
import {promises as fs} from 'node:fs'
import fs from 'node:fs/promises'
import {compile} from '@mdx-js/mdx'
import rehypeKatex from 'rehype-katex'
import remarkMath from 'remark-math'
Expand Down
4 changes: 2 additions & 2 deletions packages/esbuild/lib/index.js
Expand Up @@ -13,8 +13,8 @@
* @typedef {ProcessorOptions & {allowDangerousRemoteMdx?: boolean}} Options
*/

import assert from 'node:assert'
import {promises as fs} from 'node:fs'
import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import path from 'node:path'
import process from 'node:process'
import fetch from 'node-fetch'
Expand Down
4 changes: 2 additions & 2 deletions packages/mdx/readme.md
Expand Up @@ -75,7 +75,7 @@ export const Thing = () => <>World!</>
Add some code in `example.js` to compile `example.mdx` to JavaScript:

```js
import {promises as fs} from 'node:fs'
import fs from 'node:fs/promises'
import {compile} from '@mdx-js/mdx'

const compiled = await compile(await fs.readFile('example.mdx'))
Expand Down Expand Up @@ -481,7 +481,7 @@ object form).
Assuming `example.mdx` from [§ Use][use] exists, then:

```js
import {promises as fs} from 'node:fs'
import fs from 'node:fs/promises'
import {SourceMapGenerator} from 'source-map'
import {compile} from '@mdx-js/mdx'

Expand Down
2 changes: 1 addition & 1 deletion packages/node-loader/lib/index.js
Expand Up @@ -11,7 +11,7 @@
* @typedef {CompileOptions & LoaderOptions} Options
*/

import {promises as fs} from 'node:fs'
import fs from 'node:fs/promises'
import path from 'node:path'
import {URL, fileURLToPath} from 'node:url'
import {VFile} from 'vfile'
Expand Down
2 changes: 1 addition & 1 deletion script/jsx-loader.js
@@ -1,4 +1,4 @@
import {promises as fs} from 'node:fs'
import fs from 'node:fs/promises'
import path from 'node:path'
import {URL, fileURLToPath} from 'node:url'
import {transform, transformSync} from 'esbuild'
Expand Down

0 comments on commit fa9c42a

Please sign in to comment.