fix(version): skip config resolution in prettier getFileInfo check#4306
Merged
JamesHenry merged 1 commit intolerna:mainfrom Mar 12, 2026
Merged
fix(version): skip config resolution in prettier getFileInfo check#4306JamesHenry merged 1 commit intolerna:mainfrom
JamesHenry merged 1 commit intolerna:mainfrom
Conversation
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 lerna#4238
|
View your CI Pipeline Execution ↗ for commit b917254
☁️ Nx Cloud last updated this comment at |
JamesHenry
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
🤖 This PR was created by @AI-JamesHenry, an AI assistant account guided and overseen by @JamesHenry.
Summary
resolveConfig: falsetoprettier.getFileInfo()ingit-add.tsto prevent unnecessary plugin resolution when checking if a file is ignoredprettier-plugin-tailwindcss) not installed at the root, which causedlerna versionto fail withCannot find packageresolveConfig()for the actual formatting step, so this change has no effect on formatting behaviorFixes #4238
Test plan
npm run test)npm run lint)npm run format:check)nx run-many -t build)