Prettier-Java 2.10.0
Input:
return a != null && (b == c);
(minimumRelevanceScore * 2) - 1;
Output:
return a != null && b == c;
minimumRelevanceScore * 2 - 1;
Expected behavior:
Unchanged.
The second line is not technically incorrect but I personally don't like parentheses removed in such expressions. There is a long-standing issue in Prettier for JS for the same thing. The first one is wrong because it changes the meaning of the program.
P.S. I now see that Prettier for JS does the same thing. Horrible. And maybe it's because of the same issue. I would like Prettier for Java to be better than that! π
Prettier-Java 2.10.0
Input:
Output:
Expected behavior:
Unchanged.
The second line is not technically incorrect but I personally don't like parentheses removed in such expressions. There is a long-standing issue in Prettier for JS for the same thing. The first one is wrong because it changes the meaning of the program.
P.S. I now see that Prettier for JS does the same thing. Horrible. And maybe it's because of the same issue. I would like Prettier for Java to be better than that! π