Open
Description
Bug Report
π Search Terms
.js extension missing; ECMAScript modules; ESNext
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
Not possible, needs refactoring functionality.
π» Code
Open TypeScript project in VSCode with the following in settings.json
:
{ "typescript.preferences.importModuleSpecifierEnding": "js" }
tsconfig.json
:
{
"compilerOptions": {
"module": "ESNext"
}
}
Create a file main.ts
:
function foo() { }
function bar() { foo(); }
Execute "Move to new file" refactoring on the foo
function.
π Actual behavior
The following import is generated:
import { foo } from "./foo";
π Expected behavior
import { foo } from "./foo.js";