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
Wanted to get thoughts on prettier enforcing braces around conditionals (example below). I believe prettier-js has shot down this request in the past on the grounds that they don't want to modify the AST, but I'm not sure if prettier-java has already crossed that bridge. It would probably be a controversial decision and is maybe a slippery slope, but I think it's pretty well-established at this point that using braces around conditionals is a best practice for correctness and maintainability, so I think it would be reasonable for prettier-java to enforce it.
*Prettier-Java 1.0.2
# Options (if any):
--print-width 80
Input:
publicclassTest {
publicvoidmethod() {
if (true) System.out.println("hi");
}
}
Output:
publicclassTest {
publicvoidmethod() {
if (true) System.out.println("hi");
}
}
Wanted to get thoughts on prettier enforcing braces around conditionals (example below). I believe prettier-js has shot down this request in the past on the grounds that they don't want to modify the AST, but I'm not sure if prettier-java has already crossed that bridge. It would probably be a controversial decision and is maybe a slippery slope, but I think it's pretty well-established at this point that using braces around conditionals is a best practice for correctness and maintainability, so I think it would be reasonable for prettier-java to enforce it.
*Prettier-Java 1.0.2
# Options (if any): --print-width 80
Input:
Output:
Expected behavior:
The text was updated successfully, but these errors were encountered: