prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

Support prettier option `pluginSearchDirs`

Open vuolter opened this issue 2 years ago • 6 comments
trafficstars

The option pluginSearchDirs is supported by prettier's configuration file: https://prettier.io/docs/en/plugins.html#using-plugins.

Setting this option directly in the vscode extension will allow to manage the prettier's plugin discovery, definitely useful to workaround these issues: https://github.com/prettier/prettier/issues/8056 https://github.com/withastro/prettier-plugin-astro/issues/97

Think about this. Thank you. 😉

vuolter avatar Feb 25 '23 15:02 vuolter

FYI: Prettier is removing this option.

fisker avatar Apr 25 '23 09:04 fisker

@fisker any other ideas on how to solve those issues mentioned above (plugin(s) not detectable by vscode)?

eldair avatar Apr 25 '23 09:04 eldair

Put {plugins: []} in your .prettierrc.

fisker avatar Apr 25 '23 09:04 fisker

Yeah, tried that :/ but not working when installing with pnpm :/ EDIT: unless you mean to put an empty array, I didn't try that

eldair avatar Apr 25 '23 09:04 eldair

If it doesn't work, it's bug in prettier, you can open an issue on prettier repo.

You can also try

// prettier.config.cjs
module.exports = {
  plugins: [require("your-plugin")]
};

OR

// prettier.config.cjs
module.exports = {
  plugins: [require.resolve("your-plugin")]
};

fisker avatar Apr 25 '23 09:04 fisker

@fisker thanks for the suggestions, I will try those as well :)

eldair avatar Apr 25 '23 09:04 eldair