Skip to content

Instantly share code, notes, and snippets.

@akshitkrnagpal
Last active May 4, 2025 15:07
Show Gist options
  • Select an option

  • Save akshitkrnagpal/d024afac090f0cc59a46b2bae2371ebb to your computer and use it in GitHub Desktop.

Select an option

Save akshitkrnagpal/d024afac090f0cc59a46b2bae2371ebb to your computer and use it in GitHub Desktop.
Prettier with VSCode and pnpm

When setting up prettier with vscode and pnpm, you need to make sure vscode uses local prettier instead of prettier from vscode extension.

You can do so by providing the prettier path in prettier.prettierPath settings which is usually ./node_modules/prettier.

But with pnpm the binary isn't located in node_modules by default. But you can set public-hoist-pattern[]=prettier in .npmrc and reinstall, so that pnpm installs prettier in node_modules.

public-hoist-pattern[]=prettier
{
"prettier.prettierPath": "./node_modules/prettier"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment