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

Documentation update for prettier v3? #714

Closed
kyle-blair opened this issue Aug 29, 2023 · 3 comments
Closed

Documentation update for prettier v3? #714

kyle-blair opened this issue Aug 29, 2023 · 3 comments

Comments

@kyle-blair
Copy link

Before I open a pull request, I wanted to confirm that functionality is now slightly different from the current README.

I upgraded prettier to v3 and was getting the error:
[error] No parser could be inferred for file "/path/to/xml/file.xml".

I was able to fix this by adding the following plugin section to my .prettierrc file:

    "plugins": ["@prettier/plugin-xml"]

This wasn't entirely obvious anywhere in the documentation either here or in the main prettier repo. I think it would be useful to mention here now that plugin search has been disabled in prettier v3?

@kddnewton
Copy link
Member

I think it's documented pretty clearly under the plugins section? https://prettier.io/docs/en/plugins#using-plugins

But yes, please open a PR for the README here, that would be great.

@kyle-blair
Copy link
Author

Ah, I glossed over this line

Strings provided to plugins are ultimately passed to import() expression, so you can provide a module/package name, a path, or anything else import() takes.

I tried a few things unsuccessfully (plugin-xml, prettier-plugin-xml) before using the full npm package name (@prettier/plugin-xml). The README here implied it should "just work", which threw me off a little longer. I'll open a PR asap. Thanks.

@kddnewton
Copy link
Member

Fixes on main

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

No branches or pull requests

2 participants