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-plugin-organize-imports out of the box #463

Open
Shinigami92 opened this issue Feb 9, 2021 · 3 comments
Open

Support prettier-plugin-organize-imports out of the box #463

Shinigami92 opened this issue Feb 9, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@Shinigami92
Copy link
Contributor

I don't know why, but currently https://github.com/simonhaenisch/prettier-plugin-organize-imports#readme is not supported out of the box
So we need to use npx prettier --loglevel silent --write . && npx prettierx --write . so prettier sorts the imports and then prettierx can apply all it's extras

Maybe it's just an update to the newest prettier under the hood, but I don't know 🤷

@brody4hire
Copy link
Owner

A "minimal reproduction" would have been helpful but I noticed a reference from poolifier/poolifier#97, will take a look there.

You can also try using prettierX as a Prettier plugin by just adding prettier-plugin-x. I have documented this but it is still in pre-alpha state.

I did try merging updates from Prettier 2.1.0 (PR #422) but it is a big mess due to the number of src and test files moved around. I will likely need to rebase prettierX updates on Prettier 2.2.x (issue #414).

I may need some time to get to this due to some other priorities. Thanks for reporting.

@Shinigami92
Copy link
Contributor Author

Using prettier-plugin-x could be a solution, but sadly it doesn't work with VS Code formatOnSave 🙁
And that is the main wanted feature of my issue.

Also it has some problems, but maybe my setup is wrong?

I created a draft PR on our repo, please have a look and feel free to experiment with it

@brody4hire
Copy link
Owner

I created a draft PR on our repo, please have a look and feel free to experiment with it

(poolifier/poolifier#129)

The explanation is that using --parser=x-babel or --parser=x-typescript causes Prettier to fail with other extensions such as .yaml, .md, and .json like I see happening in poolifier/poolifier#129.

I have just published a couple of shared config packages (see https://prettier.io/docs/en/configuration.html#sharing-configurations) that should be able to help resolve the issue with the extensions:

They could probably use some more documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants