There's a really annoying bug with prettier at the moment that basically means that plugins won't automatically register when you install them with PNPM. I've found a fix, and it's not the worst, though it's certainly not the best. There's currently a PR in Prettier to fix this issue, but it hasn't had any activity for a few months. Still, I encourage you to subscribe to the PR--it should fix this issue once it is merged.
What you need to do is:
- Install prettier and any plugins locally as dev dependencies (e.g.
pnpm add -D prettier prettier-plugin-astro ...
) - Add relative paths to any plugins you are using to your
.prettierrc
file.
-
JSON config file: