Skip to content

Compatability with prettier-plugin-tailwindcss #4

@gaufde

Description

@gaufde

First of all, Thank you! Of all the Twig plugins for Prettier I have tried recently this is the only one that seems to work right now!

I don't know enough about how these things work, but I'm curious what it would take for this plugin to be compatible with prettier-plugin-tailwindcss.

Right now, I have both plugins working independently. What I mean by this is that I can see that tailwind classes are re-sorted when I save a .html file, and formatting is updated when I save a .twig or a .html.twig file. However, tailwind classes inside the .twig files are not re-sorted.

Is it possible to have both plugins work together? Or, does this quote from the prettier-plugin-tailwindcss readme mean that it might not be possible at all?

This plugin uses Prettier APIs that can only be used by one plugin at a time, making it incompatible with other Prettier plugins implemented the same way.
-https://github.com/tailwindlabs/prettier-plugin-tailwindcss#compatibility-with-other-prettier-plugins

I am using:

  • prettier 3.1.1
  • prettier-plugin-tailwindcss 0.5.11
  • @nsetyo/prettier-plugin-twig 0.1.4

This comment may be relevant to understanding how Prettier works: prettier/prettier#10261

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions