Skip to content

Organize Imports removes aliased imports that are in use. #22743

@chriseppstein

Description

@chriseppstein

TypeScript Version: 2.8.0-rc, 2.8.0-insiders.20180320

VS Code Version:

Version 1.22.0-insider (1.22.0-insider)
5be9e9e7eef715539efd5341fdbc8ec5840cfc56

2018-03-20T06:06:11.908Z

Search Terms: organize import imports remove alias

Code

import { Type as TSType } from "typescript";

export function isTSType(v: any): v is TSType {
  return !!v;
}

Expected behavior:

Running "TypeScript: Organize Imports" in VS Code makes no change to the import statements.

Actual behavior:

The import statement is removed.

Work around:

Remove as <ident>from the import statement and the import statement is left untouched by the "Organize Imports" command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Organize ImportsIssues with the organize imports featureFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions