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
I haven't found a way of doing this, nor an issue regarding it - so I may be in the minority here. I love the idea of prettier, and have always loved go fmt for the same reasons - but the Golang tool takes it a step further and I am looking for a tool to emulate this in the JS ecosystem.
The idea is that for a given source AST, irrespective of source formatting, we get a given output. Currently prettier allows the source formatting to inform the output formatting.
I kinda want this to completely eliminate any author style on the resultant code, but have prettier enforce all style decisions.
The simplest example I can think of is the following, where the 2 declarations could each fit on a single line, but prettier does not force the first one to be a one-liner.
I haven't found a way of doing this, nor an issue regarding it - so I may be in the minority here. I love the idea of prettier, and have always loved
go fmt
for the same reasons - but the Golang tool takes it a step further and I am looking for a tool to emulate this in the JS ecosystem.The idea is that for a given source AST, irrespective of source formatting, we get a given output. Currently prettier allows the source formatting to inform the output formatting.
I kinda want this to completely eliminate any author style on the resultant code, but have prettier enforce all style decisions.
The simplest example I can think of is the following, where the 2 declarations could each fit on a single line, but prettier does not force the first one to be a one-liner.
Prettier 1.19.1
Playground link
Input:
Output:
Example deterministic behavior:
The text was updated successfully, but these errors were encountered: