镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Description

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 Andrew Branch (@andrewbranch)

Activity

  1. andrewbranch commented on Jan 6, 2020

    @andrewbranch
    Member

    Already working on this one (it’s one of the two unchecked to-do boxes on the original PR)

  2. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions