#Prettier + pnpm
1 messages · Page 1 of 1 (latest)
How are you using Prettier, in the CLI or in the editor?
@winter swallow - in the editor via extension.
With Prettier's extension or Astro's?
I usually use Prettier's VSC extension globally on all projects. When initialising the repo with Astro, it seems like it uses the local prettier module though which formats Astro but not CSS.
Did you edit your user settings to use the Astro extension?
I didn't edit any settings, when I tried pnpm, prettier automatically threw an error and no formatting was done on any files, despite local node_modules being loaded.
After initializing with yarn, .astro files are being formatted automatically, but CSS is not. I didn't edit any specific settings and just have a global config in my prettier extensions in VSC.
If you didn't edit any settings, I don't think your Prettier extension is formatting Astro files, they need to be included manually in the VS Code config
I'm not sure why the Prettier extension wouldn't format CSS files, but that seems unrelated to us
I think whats happening is that its taking a local config, but disregards the global one. Thanks, I'll try to resolve it :/
In Astro 3 we're removing the dep on Prettier, so hopefully that would solve it too
Thank you, actually some clues - I previously put Astro as the main formatter for VSCode. Putting back prettier started formatting all files aside of .astro. Now everything works except for the Astro specific files, so the problem is reverse.
dev dependency installed via pnpm > pnpm install -D prettier prettier-plugin-astro
Tried the workaround in the docs:
prettier --write . --plugin=prettier-plugin-astro but it also doesn't work 😦
You might need to specify .astro files manually in the glob due to a bug in Prettier 3