Skip to content

Instantly share code, notes, and snippets.

View Jacob-Lockwood's full-sized avatar

Jacob Jacob-Lockwood

View GitHub Profile
@Jacob-Lockwood
Jacob-Lockwood / prettier-pnpm.md
Created January 31, 2023 16:04
Use prettier plugins with PNPM and VSCode

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:

  1. Install prettier and any plugins locally as dev dependencies (e.g. pnpm add -D prettier prettier-plugin-astro ...)
  2. Add relative paths to any plugins you are using to your .prettierrc file.
  • JSON config file: