From 1beecd3ae892253c5e46848c2a8d5e041f3c985a Mon Sep 17 00:00:00 2001 From: Sahin Vardar Date: Sat, 14 Dec 2024 16:14:29 +0100 Subject: [PATCH] fix: prettier svelte plugin import (#32) --- src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 434e15a..fbbcf9c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,6 +2,7 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import url from 'node:url'; import prettier from 'prettier'; +import prettierPluginSvelte from 'prettier-plugin-svelte'; export async function scanDir(dir: string, filter?: (file: string) => boolean) { const result: string[] = []; @@ -34,6 +35,6 @@ export function __dirname(meta: ImportMeta) { export async function formatSvelte(code: string) { return prettier.format(code, { parser: 'svelte', - plugins: [require('prettier-plugin-svelte')] + plugins: [prettierPluginSvelte] }); }