Hi I'm having problems supporting the "lib" property in tsconfig
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 Object.assign
and Promise<any>
.
I've restarted the IDE multiple times, and nothing seems to change, any ideas on how to fix or debug this?
//tsconfig.json
{
"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": [
"dom",
"es6"
],
"types": [
"hammerjs",
"jasmine",
"node",
"protractor",
"selenium-webdriver",
"source-map",
"uglify-js",
"webpack"
]
},
"exclude": [
"node_modules",
"dist"
],
"awesomeTypescriptLoaderOptions": {
"forkChecker": true,
"useWebpackText": true
},
"compileOnSave": false,
"buildOnSave": false,
"atom": { "rewriteTsconfig": false }
}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With