Closed
Description
TypeScript Version: 3.5.2, 3.6.2
Search Terms:
Code
// ./src/foo.ts
export const whatever = 1;
// ./src/index.ts
import * as foo from './foo';
const bar = foo.whatever;
export default bar;
Expected behavior:
When copying the line const bar
and actioning the "Move to new file" command, the new file contents should be:
import * as foo from './foo';
export const bar = foo.whatever;
Actual behavior:
The new file contents are:
export const bar = foo.whatever;
The foo
namespace import is missing, which creates errors:
Playground Link:
Related Issues: #27937, which was apparently fixed but it seems to be happening again.