diff --git a/src/preprocessors/preprocessor.ts b/src/preprocessors/preprocessor.ts index 72e6d9c..3eed078 100644 --- a/src/preprocessors/preprocessor.ts +++ b/src/preprocessors/preprocessor.ts @@ -17,6 +17,11 @@ export function preprocessor(code: string, options: PrettierOptions): string { plugins, }; + // short-circuit if importOrder is an empty array (can be used to disable plugin) + if (!remainingOptions.importOrder.length) { + return code; + } + // Astro component scripts allow returning a response if (options.parentParser === 'astro') { parserOptions.allowReturnOutsideFunction = true; @@ -53,11 +58,6 @@ export function preprocessor(code: string, options: PrettierOptions): string { return code; } - // short-circuit if importOrder is an empty array (can be used to disable plugin) - if (!remainingOptions.importOrder.length) { - return code; - } - const nodesToOutput = getSortedNodes( allOriginalImportNodes, remainingOptions,