-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"Remove 'type' from import" produces invalid syntax #55363
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
🔎 Search Terms
"Remove 'type' from import", IntelliSense, autocomplete, suggestion
🕗 Version & Regression Information
I'm seeing this in VSCode, with all extensions disabled:
Bundled TypeScript version: v5.1.0
Version: 1.81.0
Commit: 6445d93c81ebe42c4cbd7a60712e0b17d9463e97
Date: 2023-08-02T12:38:28.722Z (1 wk ago)
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.6.0
⏯ Playground Link
N/A
💻 Code
Use the following files:
// main.ts
import { TwistyAlgEditor, type TwistyPlayer } from "./other-file";
new TwistyPlayer();
// other-file.ts
export class TwistyAlgEditor {}
export class TwistyPlayer {}Then attempt to select the Remove 'type' from import of 'TwistyPlaver' from "cubing/twisty" suggestion for new TwistyPlayer:
🙁 Actual behavior
The code is rewritten to:
import { TwistyAlgEditorTwistyPlayer, } from "./other-file";
new TwistyPlayer();🙂 Expected behavior
The code is rewritten to:
import { TwistyAlgEditor, TwistyPlayer } from "./other-file";
new TwistyPlayer();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue