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
Prettier still isn't fully "deterministic." Running identical-except-for-whitespace files through Prettier with the same options should always yield the same results. The Rationale pages calls this "reversibility." It also states:
the team is still looking for heuristics that would allow either to remove this behavior completely or at least to reduce the number of situations where it’s applied
with regard to the problem of object literals not being reversible.
Question
I haven't seen anything about the progress of this in the issues, so my question is, what is the current status? Will this problem ever be solved? Since adding new options/modes to Prettier is not allowed, what is the team working on that will allow for Prettier to finally become fully deterministic?
Example
For completeness, here's an explicit example of the problem.
Input 1:
constx={y:
0};
Output 1:
constx={y: 0};
Input 2:
constx={y: 0};
Output 2:
constx={y: 0,};
Expected behavior:
Since inputs 1 and 2 are syntactically identical, outputs 1 and 2 should be exactly the same. I don't even care what the outputs look like (that's for my fancy opinionated formatter to decide), as long as they are the same. I want my opinionated formatter to have more opinions! Don't make/let me decide how my object literals should look.
The text was updated successfully, but these errors were encountered:
Background
Prettier still isn't fully "deterministic." Running identical-except-for-whitespace files through Prettier with the same options should always yield the same results. The Rationale pages calls this "reversibility." It also states:
with regard to the problem of object literals not being reversible.
Question
I haven't seen anything about the progress of this in the issues, so my question is, what is the current status? Will this problem ever be solved? Since adding new options/modes to Prettier is not allowed, what is the team working on that will allow for Prettier to finally become fully deterministic?
Example
For completeness, here's an explicit example of the problem.
Input 1:
Output 1:
Input 2:
Output 2:
Expected behavior:
Since inputs 1 and 2 are syntactically identical, outputs 1 and 2 should be exactly the same. I don't even care what the outputs look like (that's for my fancy opinionated formatter to decide), as long as they are the same. I want my opinionated formatter to have more opinions! Don't make/let me decide how my object literals should look.
The text was updated successfully, but these errors were encountered: