Experimental decorators warn VSCODE

I am working on an Angular2 application - Typescript. I created a project with angular-cli as follows:

ng new myApp 

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

I tried to solve the following message:

Warning experimental decorators in Visual Studio code

but not working for me.

I am attaching 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: "typescript": "2.0.2"

+5
source share
1 answer

Finally, I solved my problem as follows:

Firstly, updating the typescript version:

 $ npm install typescript@next 

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

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

Thanks peeskillet :)

+1
source

Source: https://habr.com/ru/post/1257499/


All Articles