Skip to content

[typescript] VS Code won't use lib ES2015 type definitions #14123

@ricokahler

Description

@ricokahler

I'm trying to use some ES2015 features (specifically Object.assign).

Since typescript 2, there is built in type definitions for ES2015 using the --lib option and similarly, there is a lib compilerOptions key in the tsconfig.json file.

I have the lib option changed to contain es2015. My project compiles fine with from tsc with no errors but VS Code yells at me for using Object.assign and other ES2015 features.

I see that VS Code actually contains the type definitions in Microsoft VS Code\resources\app\extensions\typescript\server\typescript\lib\lib.es2015.d.ts.

Is there a way to get vs code to use those type definitions? Is this a bug and should this already happen?

I already have webpack including the respective polyfills but I can't seem to get the type definitions working in vs code. Any ideas?

Thanks!

  • VSCode Version:
    1.6.1
  • OS Version:
    Windows 10
    Steps to Reproduce:
  1. Use vs code to open a typescript project with es2015 types with an es5 target.
  2. Observe that vs code yells at you
    image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions