Skip to content

Do not return 'declare' or 'add index signature' quick fixes for types that are part of lib.d.ts #29482

Closed
@mjbvz

Description

@mjbvz

TypeScript Version: typescript@3.3.0-dev.20190118

Search Terms:

  • quick fix
  • code action
  • lib.d.ts

Code

For the code:

async function a() {
    const response = await fetch(`https://example.com`);
   response.jsonX();
}

Trigger quickfixes on jsonX

Bug
declare and add index quick fixes returned. These modify the dom.d.ts declarations of fetch.

screen shot 2019-01-18 at 11 27 01 am

We should never try to edit the lib.d.ts files

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions