Skip to content

Commit fa9c42a

Browse files
committed
Refactor code-style
1 parent 5cb07ab commit fa9c42a

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

docs/guides/frontmatter.server.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ title: Hi, World!
4747
Then without compiling or evaluating the metadata can be accessed like so:
4848

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

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

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

docs/guides/gfm.server.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ A note[^1]
5151
The above MDX with GFM can be transformed with the following module:
5252

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

docs/guides/math.server.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Say we have an MDX file like this:
3131
The above MDX with math can be transformed with the following module:
3232

3333
```js path="example.js"
34-
import {promises as fs} from 'node:fs'
34+
import fs from 'node:fs/promises'
3535
import {compile} from '@mdx-js/mdx'
3636
import rehypeKatex from 'rehype-katex'
3737
import remarkMath from 'remark-math'

packages/esbuild/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* @typedef {ProcessorOptions & {allowDangerousRemoteMdx?: boolean}} Options
1414
*/
1515

16-
import assert from 'node:assert'
17-
import {promises as fs} from 'node:fs'
16+
import assert from 'node:assert/strict'
17+
import fs from 'node:fs/promises'
1818
import path from 'node:path'
1919
import process from 'node:process'
2020
import fetch from 'node-fetch'

packages/mdx/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const Thing = () => <>World!</>
7575
Add some code in `example.js` to compile `example.mdx` to JavaScript:
7676

7777
```js
78-
import {promises as fs} from 'node:fs'
78+
import fs from 'node:fs/promises'
7979
import {compile} from '@mdx-js/mdx'
8080

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

483483
```js
484-
import {promises as fs} from 'node:fs'
484+
import fs from 'node:fs/promises'
485485
import {SourceMapGenerator} from 'source-map'
486486
import {compile} from '@mdx-js/mdx'
487487

packages/node-loader/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @typedef {CompileOptions & LoaderOptions} Options
1212
*/
1313

14-
import {promises as fs} from 'node:fs'
14+
import fs from 'node:fs/promises'
1515
import path from 'node:path'
1616
import {URL, fileURLToPath} from 'node:url'
1717
import {VFile} from 'vfile'

script/jsx-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {promises as fs} from 'node:fs'
1+
import fs from 'node:fs/promises'
22
import path from 'node:path'
33
import {URL, fileURLToPath} from 'node:url'
44
import {transform, transformSync} from 'esbuild'

0 commit comments

Comments
 (0)