Closed
Description
Bug Report
🔎 Search Terms
extract function single-line if
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about whether Tang was really invented by NASA
💻 Code
function f() {
return [].filter(x => {
if (!x) return false;
});
}
🙁 Actual behavior
Select the arrow function callback of filter
and run “Extract to inner function.” The formatting of the function contents should be the same in the extracted function.
🙂 Expected behavior
function newFunction(): (value: any, index: number, array: any[]) => unknown {
return x => {
if (!x)
return false; // New line added
};
}