visual studio code - In VSCode turn off the following warning Accessors are only available when targeting ECMAScript 5 and higher -
the type script code writing compiles fine. issue in visual studio code see following warning.
there similar question on compiling tyepscript works . see above warning , cannot figure out how turn off.
i read update tsconfig.json far can tell mine correct.
my tsconfig.json
{ "compileonsave": false, "compileroptions": { "outdir": "./dist/out-tsc", "sourcemap": true, "declaration": false, "moduleresolution": "node", "emitdecoratormetadata": true, "experimentaldecorators": true, "target": "es2017", "typeroots": [ "node_modules/@types" ], "lib": [ "es2016", "dom" ] } }
if create application via angular cli, ng new project, create 2 tsconfig.json 1 in root folder of project , 1 in src folder. web pack when calling ng serve uses tsconfig.json in root of project while vscode uses 1 in src folder.
|-tsconfig.json |-src |-tsconfig.json
to resolve: update compiler options tsconfig.json in src folder follows
add "target": "es2017"
{ "compileroptions": { "experimentaldecorators": true, "allowjs": true, "target": "es2017" } }
Comments
Post a Comment