Closed
Description
Prettier-Java 2.2.0
The formatting is not stable with the following code structure and needs to be run twice to get to a stable state:
$ yarn add prettier prettier-plugin-java
$ cat initial.java
package main;
class Main {
public static void main(String[] args) {
if (true) // comment
{
System.out.println("Oops");
}
}
}
$ yarn -s prettier --plugin prettier-plugin-java initial.java | tee first.java
package main;
class Main {
public static void main(String[] args) {
if (
true
) { // comment
System.out.println("Oops");
}
}
}
$ yarn -s prettier --plugin prettier-plugin-java first.java | tee second.java
package main;
class Main {
public static void main(String[] args) {
if (true) { // comment
System.out.println("Oops");
}
}
}
Expected behavior:
The prettier-java-plugin should only require one format execution to properly format the code.
Metadata
Metadata
Assignees
Labels
No labels