-
Notifications
You must be signed in to change notification settings - Fork 97
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
Prettier doesn't seem to be aware of the plugin when installed with pnpm #155
Comments
// Works
// Fails -
|
Oh it works if you add the pnpx degit sveltejs/template my-svelte-project |
Prettier currently has a PR that fixes this prettier/prettier#9167 |
got it to work with .prettierrc.js
|
Same here. It only worked with the .prettierrc as js file.
But if I change the code json format as ".prettierrc" file it won’t work since there seems to be a problem with the plugin. Because once I added the plugin line it stopped working entirely. |
Strangely for me, keeping it as JSON and specifying the {
"proseWrap": "never",
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"plugins": ["prettier-plugin-svelte"]
} Versions: EDIT: Seems like the above only works when running through the command line. Doesn't work in vscode. Setting to |
I have the same issue with prettier-plugins-jsdoc My npmrc
|
In fact, there are two simultaneous issues:
|
Thank you @martinjeromelouis! Your solution worked for me. |
for sveltekit it seemed to have helped to add |
so how would one get the vscode extension to work out of the box on svelte files with |
For those trying to figure out what's going on, when mounted into the
|
Thanks @martinjeromelouis Confirming that this solution still works perfectly, with several other plugins like it works both with command line prettier and VScode format on save option. |
It start working in VSCode after adding .prettierrc: {
"pluginSearchDirs": ["."]
} VSCode setting (e.g.
|
The minimum change I needed to make this work for both the CLI and VSCode was to add this to {
"plugins": ["prettier-plugin-svelte"]
} |
In case anyone wondering using |
I managed to launch prettier plugins by specifying them in .prettierrc |
Got my Prettier back working with |
Also getting this:
I also tried removing all plugins but then it complains about the parser that it could not find... |
I think this issue is already fixed in Prettier v3 and can be closed. Plugins should be specified via: {
"plugins": ["prettier-plugin-svelte"]
} In the prettier config file. The repo's readme is already updated with this info. |
Hm yeah for Prettier v3, but no, it seems to be a Prettier VS Code v10 issue. Downgraded to v9 and it works again. |
My solution in the end was to change to: which got things working again. |
Same for me. |
Not sure how to give any useful info here.
But when using this plugin with pnpm prettier doesn't seem to detect it.
I don't know what the root cause is, if it's in pnpm, prettier or the plugin.
But i am issuing it here as it seem to be most reasonable to start.
I will gladly help out as much as i can as i am the one asking here with basically no useful information, so just ask don't be shy!
The text was updated successfully, but these errors were encountered: