Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dprint moves else to the wrong if #632

Closed
nicolo-ribaudo opened this issue May 5, 2024 · 1 comment · Fixed by #633
Closed

dprint moves else to the wrong if #632

nicolo-ribaudo opened this issue May 5, 2024 · 1 comment · Fixed by #633
Labels
bug Something isn't working

Comments

@nicolo-ribaudo
Copy link
Contributor

Describe the bug

dprint-plugin-typescript version: x.x.x

Input Code

https://dprint.dev/playground/#code/JYMwFAhglA3qYCNYGMD2A7AzqgNgUwDodUBzMABigG4BfGvHTPAAngBMUNt8jSwBGavUZ4YaLLkLEyAJiFA/config/N4XyA/plugin/typescript

if(a){if(b){console.log(0);}}else if(d){console.log(1);}else{console.log(2);}

Expected Output

Something so that if a is false and d is true that code logs 1

Actual Output

if (a) if (b) console.log(0);
else if (d) console.log(1);
else console.log(2);

which, when a is false, logs nothing.

@dsherret
Copy link
Member

dsherret commented May 5, 2024

Thanks! That's pretty bad. Fixed in 0.90.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants