Skip to content

Commit 860f173

Browse files
committed
chore: move prettier config file to ESM
1 parent 11fe3d9 commit 860f173

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
File renamed without changes.

tools/generate-configs/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { writeFile } from 'node:fs/promises';
22
import { resolve } from 'node:path';
33

4-
import { format, resolveConfig } from 'prettier';
4+
import * as prettier from 'prettier';
55

66
import type { TSESLint } from '@typescript-eslint/utils';
77

88
const __dirname = new URL('.', import.meta.url).pathname;
99

10-
const prettierConfig = resolveConfig(__dirname);
10+
const prettierConfig = prettier.resolveConfig(__dirname);
1111

1212
const addAutoGeneratedComment = (code: string) =>
1313
[
@@ -30,7 +30,7 @@ export const writeConfig = async (
3030
3131
export default ${JSON.stringify(config)} satisfies Linter.LegacyConfig;
3232
`;
33-
const configStr = await format(addAutoGeneratedComment(code), {
33+
const configStr = await prettier.format(addAutoGeneratedComment(code), {
3434
parser: 'typescript',
3535
...(await prettierConfig),
3636
});

0 commit comments

Comments
 (0)