-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.103.2
- OS Version: Darwin arm64 24.6.0
Steps to Reproduce:
git clone https://github.com/ulrichstark/vscode-type-import-repro.git
code vscode-type-import-repro --disable-extensions
- open file
a.ts
by double clicking - open file
b.ts
by double clicking - save file
b.ts
import type { helloWorld } from "./a";
gets automatically added into fileb.ts
Files of repro project:
.vscode/settings.json
{
"editor.codeActionsOnSave": {
"source.addMissingImports.ts": "explicit"
},
"typescript.preferences.preferTypeOnlyAutoImports": true
}
a.ts
export function helloWorld() {
console.log("Hello World!");
}
b.ts
if (true) {
helloWorld();
}
helloWorld();
Results
function helloWorld
is imported as type resulting in error:
'helloWorld' cannot be used as a value because it was imported using 'import type'.
Actual
import type { helloWorld } from "./a";
if (true) {
helloWorld();
}
helloWorld();
Expected
import { helloWorld } from "./a";
if (true) {
helloWorld();
}
helloWorld();
Metadata
Metadata
Assignees
Labels
No labels