Prettier formatting doesn't work when SvelteKit installed with pnpm #6060
Labels
feature / enhancement
New feature or request
p2-nice-to-have
SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
pkg:create-svelte
Describe the bug
After generating new SvelteKit project with pnpm, formatting of svelte files doesn't work.
Reproduction
cd kit-prettier
pnpm install
pnpx prettier src/**/*.svelte --write
What's more, VSCode with prettier plugin installed can't format Svelte files, failing with the following error:
Severity
annoyance
Additional Information
I recognize that the team is aware of this issue because in package.json, the "format" command includes a flag that makes formatting work:
prettier --write --plugin-search-dir=. .
However, this doesn't work for VSCode prettier plugin, which can't locate the svelte-prettier-plugin.
The solution would be to add the following lines in
.prettierrc
With this in place, the VSCode formatting would work and scripts in
package.json
won't need to have the--plugin-search-dir
flag.Related issue: sveltejs/prettier-plugin-svelte#155
The text was updated successfully, but these errors were encountered: