-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do this
Milestone
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";
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do this