Possible to use to use multiple community plugins with the same parser? #10261
Labels
area:plugin api
locked-due-to-inactivity
Please open a new issue and fill out the template instead of commenting.
Hi,
It seems like multiple community plugins can't work together as soon as they override a specific prettier parser.
For example, prettier-plugin-jsdoc and prettier-plugin-organize-imports.
It is most likely due to the fact that both plugins are defining their own typescript parser (here and here), both importing
prettier/parser-typescript
to inherit from it.prettier-plugin-jsdoc
uses theparse
property of the typescript parser whileprettier-plugin-organize-imports
uses thepreprocess
property, but the last plugin loaded (alphabetical sort) completely overrides what is defined by the previous one.I managed to have them both working by doing something like this
.prettierrc.js
But it is not an ideal solution as it kind of loses the plugin autoloading feature by having to manually merge them (the original plugins are still autoloaded but the merged one overrides them).
Moreover, if another plugin like
prettier-plugin-tailwind
is used, which also inherits and uses theparse
property of the typescript parser, this makes it quite difficult to handle.Is there a better way to handle this use case or would it be possible for prettier to manage it by automatically composing the properties defined by custom plugins ?
Thank you for your time ✌️
Environments:
Steps to reproduce:
Expected behavior:
All plugins working together.
Actual behavior:
Only the last plugin loaded by prettier works.
The text was updated successfully, but these errors were encountered: