Introduce prePrint
property to plugin
#13827
Labels
area:api
Issues with Prettier's Application Programming Interface
area:plugin api
status:needs discussion
Issues needing discussion and a decision to be made before action can be taken
Plugins can have a
prePrint
property, which replaces currentembed
, and it works same asembed
. Only difference we'll traverse AST and callprePrint.print
of ALL plugins that matches theastFormat
.Before calling
printer.print
, we traverse AST, and collect all functions returned byprePrint.print
, then call them in order, use the first doc these functions returns.A plugin with
prePrint
looks like this.I think this will partly solve #10803.
This still not allow multiple plugins format the same node.
The text was updated successfully, but these errors were encountered: