From ddb1b6901b5ba5f946104e3ed14569d3b04c20bd Mon Sep 17 00:00:00 2001 From: Robert DiMartino Date: Wed, 24 Apr 2024 11:59:53 -0400 Subject: [PATCH] Allow plugin to run if prettier config is missing --- src/plugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugin.js b/src/plugin.js index 71d2030b..1b25173f 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -76,7 +76,9 @@ export async function spawnServer(opts, killOnExit = true) { if (opts.filepath) { const prettierConfig = await resolveConfigFile(opts.filepath); - options.cwd = path.dirname(prettierConfig); + if (prettierConfig) { + options.cwd = path.dirname(prettierConfig); + } } const server = spawn(