You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-7Lines changed: 30 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,33 @@ If a local configuration file cannot be found the plugin will fallback to the de
40
40
41
41
## Compatibility with other Prettier plugins
42
42
43
-
To make this plugin work we had to use private Prettier APIs that can only be used by a single plugin at once. This means this plugin is incompatible with other Prettier plugins that are using the same APIs.
44
-
45
-
The most popular example we know of is [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte), which can't be installed at the same time as the Tailwind CSS plugin.
46
-
47
-
To work around this, we've bundled `prettier-plugin-svelte` directly into `prettier-plugin-tailwindcss`, so if you'd like to use this plugin with Svelte, just uninstall `prettier-plugin-svelte` and everything should work as expected.
48
-
49
-
If you discover any other incompatibilities, please share them in [this issue](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/issues/31) and hopefully we can figure out a way to make it work.
43
+
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. To solve this we've added explicit per-plugin workarounds that enable compatibility with the following Prettier plugins:
44
+
45
+
-`@prettier/plugin-php`
46
+
-`@prettier/plugin-pug`
47
+
-`@shopify/prettier-plugin-liquid`
48
+
-`@trivago/prettier-plugin-sort-imports`
49
+
-`prettier-plugin-astro`
50
+
-`prettier-plugin-css-order`
51
+
-`prettier-plugin-import-sort`
52
+
-`prettier-plugin-jsdoc`
53
+
-`prettier-plugin-organize-attributes`
54
+
-`prettier-plugin-organize-imports`
55
+
-`prettier-plugin-style-order`
56
+
-`prettier-plugin-svelte`
57
+
-`prettier-plugin-twig-melody`
58
+
59
+
One limitation with this approach is that `prettier-plugin-tailwindcss`*must* be loaded last, meaning Prettier auto-loading needs to be disabled. You can do this by setting the `pluginSearchDirs` option to `false` and then listing each of your Prettier plugins in the `plugins` array:
0 commit comments