Skip to content

auto import always choose the type declaration in the folder that not top level #24742

Closed
@Kingwl

Description

@Kingwl

TypeScript Version: 3.0.0-dev.201xxxxx

Search Terms:

Code

// node_module/xxx/lib/index.d.ts
export declare a: number;

// src/a.ts
a/*here*/

Expected behavior:

insert the code: import { a } from 'xxx'

Actual behavior:

insert the code: import { a } from 'xxx/lib'

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions