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

Prettier plugins are not detected #3323

Open
aminya opened this issue Apr 7, 2021 · 6 comments
Open

Prettier plugins are not detected #3323

aminya opened this issue Apr 7, 2021 · 6 comments

Comments

@aminya
Copy link

aminya commented Apr 7, 2021

pnpm version: all

Code to reproduce the issue:

I am making the issue here as the original Prettier developers are not open to the fix for this.
prettier/prettier#9167
prettier/prettier#8056
sveltejs/prettier-plugin-svelte#155

Expected behavior: Prettier plugins should work without listing them

Actual behavior: Requires listing them

Additional information:

  • node -v prints: any
  • Windows, macOS, or Linux?: any
@zkochan
Copy link
Member

zkochan commented Apr 7, 2021

We are already hoisting the prettier plugins by default, is that not enough?

'@prettier/plugin-*',
'*prettier-plugin-*',

It should work unless you override the default value of public-hoist-pattern

@aminya
Copy link
Author

aminya commented Apr 7, 2021

We use public-hoist-pattern[]=* by default in all of our repositories because of #2781 and some other issues that are hard to debug. But I thought that would be enough for prettier, but it is still not.

You can test it in this repository:
https://github.com/atom-community/prettier-config-atomic

Removing plugins entry breaks prettier.

@dominikg
Copy link

as a workaround i'm using prettier js conf and require for the plugin:
sveltejs/prettier-plugin-svelte#155 (comment)

@aryzing
Copy link

aryzing commented Jan 28, 2023

@zkochan unfortunately it's not enough. Prettier also searches for namespaced plugins such as @my_namespace/prettier-plugin-foo-bar.

@paritagandhi
Copy link

I also have the same problem and I am using it for xml files. I need to explicitly give plugin and following command works
prettier --plugin=@prettier/plugin-xml --write "**/*.xml"

@mvllow
Copy link

mvllow commented Jun 19, 2024

This should no longer be relevant with prettier v3 as plugin detection has been removed.

https://prettier.io/blog/2023/07/05/3.0.0#plugin-search-feature-has-been-removed-14759httpsgithubcomprettierprettierpull14759-by-fiskerhttpsgithubcomfisker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants