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
Running Prettier twice is supposed to give the same output. There does however not appear to be a good way to figure out what a comment's indentation will be after code formatting. We therefore wrap lines at a comment's current width, but not at the width it will have after the rest of the file has been formatted:
/**
* Example example example
*/
will become:
/**
* Example example
* example
*/
which will then become:
/**
* Example example example
*/
I do run into this issue when reorganizing code.
There is a function in Prettier's API, printComment, but it is not nearly as pluggable and would require us to extend Prettier's non-exposed estree printer.
The text was updated successfully, but these errors were encountered:
printComment is so interested. These functions (printComment, canAttachComment, isBlockComment, handleComments, ownLine) are so useful for us, but I don't test these before.
Running Prettier twice is supposed to give the same output. There does however not appear to be a good way to figure out what a comment's indentation will be after code formatting. We therefore wrap lines at a comment's current width, but not at the width it will have after the rest of the file has been formatted:
will become:
which will then become:
I do run into this issue when reorganizing code.
There is a function in Prettier's API,
printComment
, but it is not nearly as pluggable and would require us to extend Prettier's non-exposedestree
printer.The text was updated successfully, but these errors were encountered: