Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Experimental decorators warning VSCODE

I'm working on an Angular2-Typescript application. I've generated the project with angular-cli as follows:

ng new myApp

but when I create a new component, a warning appears on @Component tag.

I've tried to solve following this post:

Experimental decorators warning in Visual Studio Code

but does not work for me.

I attach my tsconfig.json:

{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es6",
"typeRoots": [
  "../node_modules/@types"
  ]
 }
}

Typescript version is : "typescript": "2.0.2"

like image 882
Samuel Fraga Mateos Avatar asked Nov 09 '22 08:11

Samuel Fraga Mateos


1 Answers

Finally, I solved my problem as follows:

First, updating typescript version:

$ npm install typescript@next

and then, editing user preference in vscode, adding the following:

{
  "typescript.tsdk": "node_modules/typescript/lib"
}

Thanks to peeskillet :)

like image 137
Samuel Fraga Mateos Avatar answered Nov 15 '22 11:11

Samuel Fraga Mateos