Skip to content

Commit 0bbfc3f

Browse files
committed
Update compatibility message in readme
1 parent 6a1a9d2 commit 0bbfc3f

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

README.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,33 @@ If a local configuration file cannot be found the plugin will fallback to the de
4040

4141
## Compatibility with other Prettier plugins
4242

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:
60+
61+
```json5
62+
// .prettierrc
63+
{
64+
// ..
65+
"plugins": [
66+
"prettier-plugin-svelte",
67+
"prettier-plugin-organize-imports",
68+
"prettier-plugin-tailwindcss" // MUST come last
69+
],
70+
"pluginSearchDirs": false
71+
}
72+
```

0 commit comments

Comments
 (0)