exk0730 exk0730 - 1 year ago 105
TypeScript Question

Getting error-highlighting on things like `Object.assign` and `Promise<any>`

Hi I'm having problems supporting the "lib" property in

when using WebStorm 2016.2.2.

I've tried editing the TypeScript version in the IDE preferences (
Preferences -> Languages & Frameworks -> TypeScript
) and pointing to a globally-installed TypeScript 2.0 version, but I'm still getting error-highlighting on things like

I've restarted the IDE multiple times, and nothing seems to change, any ideas on how to fix or debug this?

"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noEmitHelpers": true,
"strictNullChecks": false,
"baseUrl": "./src",
"paths": {
"core": ["app/core"],
"reactive": ["app/reactive"],
"models": ["app/models"],
"services": ["app/services"]
"lib": [
"types": [
"exclude": [
"awesomeTypescriptLoaderOptions": {
"forkChecker": true,
"useWebpackText": true
"compileOnSave": false,
"buildOnSave": false,
"atom": { "rewriteTsconfig": false }

Answer Source

You specified:

"target": "es5"

So the compiler will compile it with the regular lib.d.ts and not the lib.es6.d.ts and so ES6 features such as Object.assign and Promise and others are missing.

Change it to

"target": "es6"

and it should be fine.