Skip to content

Auto import adds value import to type-only import statement #36002

Closed
@ajafff

Description

@ajafff

TypeScript Version: 3.8.0-dev.20200104

Search Terms:

Code

import type {SourceFile} from 'typescript';
const file: SourceFile = createSourceFile(

While typing createSourceFile use auto import.

Expected behavior:

Adds a named import for createSourceFile and removes the type keyword from the import.

Actual behavior:

Adds a named import for createSourceFile while keeping it a type-only import. This causes an error as createSourceFile does not exist in the type space.

Related Issues: Introduced by #35200 @andrewbranch

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions