Skip to content

Commit 3ecefc9

Browse files
committed
trying explicit PHP plugin loading
1 parent 59e123f commit 3ecefc9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/format-php-prettier.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
import prettier from "prettier";
1212
import prettierConfig from "@ideasonpurpose/prettier-config" with { type: "json" };
1313

14+
// Add dynamic import for the plugin
15+
const phpPlugin = (await import("@prettier/plugin-php")).default;
16+
1417
import { readFile, writeFile } from "fs/promises";
1518
import { resolve, basename } from "path";
1619

@@ -157,6 +160,7 @@ async function formatHTMLThenPHP(filepath) {
157160
...phpOptions,
158161
parser: "php",
159162
embeddedLanguageFormatting: "auto",
163+
plugins: [phpPlugin], // Explicitly pass the plugin
160164
});
161165

162166
await writeFile(filepath, phpFormatted, "utf8");

0 commit comments

Comments
 (0)