Skip to content

Commit 9a69cee

Browse files
committed
Use prettier standalone to avoid warnings
1 parent 76827a2 commit 9a69cee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plugins/rehype-static-to-dynamic.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import * as t from '@babel/types';
22
import { readFileSync } from 'fs';
33
import { dirname, join } from 'path';
4-
import * as prettier from 'prettier';
4+
import * as prettier from 'prettier/standalone';
5+
import * as prettierBabel from 'prettier/plugins/babel';
6+
import * as prettierEstree from 'prettier/plugins/estree';
57
import * as recast from 'recast';
68
import * as babelParser from 'recast/parsers/babel-ts.js';
79
import { visit } from 'unist-util-visit';
@@ -392,6 +394,7 @@ async function convertStaticToDynamic(code) {
392394
...prettierConfig,
393395
parser: 'babel',
394396
singleQuote: true,
397+
plugins: [prettierBabel, prettierEstree],
395398
});
396399

397400
// Remove trailing newline that prettier adds

0 commit comments

Comments
 (0)