<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section! Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ Please fill in the *entire* template below. --> <!-- Please try to reproduce the issue with the latest published version. It may have already been fixed. For npm: `typescript@next` This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly --> **TypeScript Version:** 3.9.0-dev.20200416 <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** - refactor / refactoring - format **Code** For the code: ```ts function foo() { if (true) { console.log(1); } else { console.log(1); } } ``` 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`: ```ts function foo() { newFunction(); } function newFunction() { if (true) { console.log(1); } else { console.log(1); } } ```
Activity