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-plugin-tailwind conflicts with other typescript plugins #23

Open
hrougier opened this issue Feb 6, 2021 · 4 comments
Open
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@hrougier
Copy link

hrougier commented Feb 6, 2021

Describe the bug

I was using prettier-plugin-organize-imports in my project. After installing prettier-plugin-tailwind, prettier-plugin-organize-imports stopped working.

This is due to the fact that both plugins are redefining the typescript parser in their configuration, both importing prettier/parser-typescript to inherit from it.

prettier-plugin-organize-imports uses the preprocess property of the parser while prettier-plugin-tailwind uses the parse property, but the last plugin loaded by prettier completely overrides any previous one.

To Reproduce
Steps to reproduce the behavior:

  1. install prettier-plugin-organize-imports, it works.
  2. install prettier-plugin-tailwind, it works but 1. not longer works.

Expected behavior

Does anyone know if it is possible to have both plugin working together (something like merging their parser configuration together)?

Versions:

  • prettier-plugin-tailwind version: 2.2.8
  • prettier-plugin-organize-imports version: 1.1.1
@hrougier hrougier added the bug Something isn't working label Feb 6, 2021
@hrougier
Copy link
Author

hrougier commented Feb 6, 2021

For information,

This was discussed here #10259.
Looks like there is a way to achieve it in #8195.

There is also a discussion for a dedicated API in #4424 to make it easier.

@tqwewe
Copy link
Owner

tqwewe commented Feb 24, 2021

@hrougier Thank you for opening this.
Unfortunately prettier has lack of support for the kind of plugins like this one and prettier-plugin-organize-imports.

I looked into this issue when writing this plugin but it seems like for now we have to wait for prettier to add better support for these cases - unless someone finds a good approach to fix this, in which case a PR would be really appreciated.

@rootusrsystem32
Copy link

any update on this?

@tqwewe
Copy link
Owner

tqwewe commented May 12, 2022

@florianbress no updates, I suggest you use the official tailwind plugin as that's more up to date

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

No branches or pull requests

3 participants