Repository navigation
Replies: 1 comment
|
This is a very helpful suggestion. Compatibility and execution order with other Prettier plugins—especially AST-transforming plugins like Tailwind, Svelte, and brace-style—is a constant source of friction for users. _Quick Response / Feedback _Refining the Ordering Guide: Instead of a strict global rule, updating the section to explain why order matters (e.g., Tailwind needing to run late to format generated utility classes) alongside a real-world example like your snippet makes the documentation much clearer. // .prettierrc
module.exports = {
plugins: [
// 1. Language-specific parser plugins
'prettier-plugin-svelte',
// 2. AST / Code transformation plugins
'prettier-plugin-brace-style', // Must run after language parsers
// 3. Class sorting plugins
'prettier-plugin-tailwindcss', // Must run near the end to format final class strings
// 4. Fallback merger for AST conflicts
'prettier-plugin-merge', // Must be LAST to resolve conflicts between overlapping plugins
],
};This would make a great update to the README to give users a clear blueprint when Prettier breaks due to plugin overlap. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The section Compatibility with other Prettier plugins should be improved.
One can use the prettier-plugin-merge to allow multiple plugins.
That plugin must be last:
As you can see various plugins must be before or after some other one, so a blanket rule regarding ordering is not viable.
This is a real pain point. The plugin natively "fixes" compatibility with other major plugins, but the user will inevitably encounter a plugin that will cause prettier to stop working. In that case "prettier-plugin-merge" is the solution.
All reactions