-
-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpectedly resolving globally installed prettier version #3475
Comments
This is definitely happening to me as well, I have
EDIT: It's even weirder, according to the below script, I have no 3.2.4 prettier installed. Now I am very confused.
|
Hmm, I had Removing both and installing back just Absolutely not sure what was happening, as the monkey c plugin was using different version:
|
This issue has been labeled as stale due to inactivity. Reply to keep this issue open. |
not stale |
In my case, |
Summary
Globally installed prettier with no workspace root
package.json
fails to resolve correct prettier config. We're using Rush which has a specific way of handling prettier config, see https://rushjs.io/pages/maintainer/enabling_prettier/. Generally, this works fine, but for one of our users, they were unable to use this VSCode extension due toInvalid prettier configuration file detected.
errors everytime they saved the file. After debugging, we discovered that they had prettier installed globally and this extension was attempting to use that version instead of the workspace one. I believe this is happening because this function doesn't stop at the workspace root and continues to resolve up, despite theresolveGlobalModules
flag not being set.Github Repository to Reproduce Issue
Since this is an interaction between global and local modules, will add steps below.
Steps To Reproduce:
(these will not replicate the exact same error, but I believe they indicate the same root cause)
resolve global modules
is unchecked in the prettier settings.package.json
at~/package.json
.{"dependencies": {"prettier": "2.2.3"}}
. The file just needs to exist, the version doesn't matter.Expected result
Continued to the use the workspace version for prettier.
Actual result
Additional information
Feel free to attach a screenshot.
VS Code Version:
Prettier Extension Version: v10.4.0
OS and version: MacOS
Prettier Log Output
The text was updated successfully, but these errors were encountered: