Closed
Description
TypeScript Version: 3.9.0-dev.20200416
Search Terms:
- refactor / refactoring
- format
Code
For the code:
function foo() {
if (true) {
console.log(1);
} else {
console.log(1);
}
}
- Select the body of the function and run
extract to function
Bug:
In the new function, a new line is added before the else
:
function foo() {
newFunction();
}
function newFunction() {
if (true) {
console.log(1);
}
else {
console.log(1);
}
}