Skip to content

Commit b917254

Browse files
committed
fix(version): skip config resolution in prettier getFileInfo check
When checking if a file is ignored by prettier, getFileInfo() was called without resolveConfig: false, causing prettier to load the full config including plugins. In monorepos where a nested project has a prettier plugin not installed at the root, this throws "Cannot find package". Since getFileInfo() is only used here to check the ignored status, and the full config is already resolved separately via resolveConfig() for the actual formatting step, passing resolveConfig: false avoids unnecessary plugin resolution. Fixes #4238
1 parent 575b248 commit b917254

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libs/commands/version/src/lib/git-add.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function maybeFormatFile(filePath) {
3535
const ignorePath = path.join(workspaceRoot, ".prettierignore");
3636
const fullFilePath = path.join(workspaceRoot, filePath);
3737

38-
const fileInfo = await resolvedPrettier.getFileInfo(fullFilePath, { ignorePath });
38+
const fileInfo = await resolvedPrettier.getFileInfo(fullFilePath, { ignorePath, resolveConfig: false });
3939

4040
if (fileInfo.ignored) {
4141
log.silly("version", `Skipped applying prettier to ignored file: ${filePath}`);

0 commit comments

Comments
 (0)