Closed
Description
TS Template added by @mjbvz
TypeScript Version: 4.0.0-dev.20200702
Search Terms
- refactor / refactoring
- VSCode Version: 1.46.1
- OS Version: MacOS 10.15.5
Steps to Reproduce:
- Have a file with a named export, that is typed like this:
export const getFoo: (input: number) => number = (input) => input;
-
Click "Convert named export to default" in the refactoring menu
-
The refactored code new lacks the typing
export default (input) => input;
I would expect the refactoring to maintain the functions typing. For example like this:
const getFoo: (input: number) => number = (input) => input;
export default getFoo;
After all, the intend of the refactoring is to change the type of the export, not the way the code is written. I mainly use this refactoring, to automatically change the imports in other files. So for me, just removing the export
before const
and add a new line with export default getFoo
would be sufficient for this refactoring.
Does this issue occur when all extensions are disabled?: Yes