Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support prettier option pluginSearchDirs #2881

Open
vuolter opened this issue Feb 25, 2023 · 6 comments
Open

Support prettier option pluginSearchDirs #2881

vuolter opened this issue Feb 25, 2023 · 6 comments

Comments

@vuolter
Copy link

vuolter commented Feb 25, 2023

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:
prettier/prettier#8056
withastro/prettier-plugin-astro#97

Think about this. Thank you. 😉

@fisker
Copy link
Member

fisker commented Apr 25, 2023

FYI: Prettier is removing this option.

@eldair
Copy link

eldair commented Apr 25, 2023

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

@fisker
Copy link
Member

fisker commented Apr 25, 2023

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

@eldair
Copy link

eldair commented Apr 25, 2023

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

@fisker
Copy link
Member

fisker commented Apr 25, 2023

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")]
};
@eldair
Copy link

eldair commented Apr 25, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants