Skip to content Skip to sidebar Skip to footer

Visual Studio 2017 Javascript How To Set 'experimentaldecorators'

Anyone knows how to get rid of this message when using Aurelia.js in VS2017?? I'm using VS2017, not VSCode, and I'm using Javascript, not Typescript as every internet article seem

Solution 1:

You need a tsconfig.json with the experimentalDecorators flag set to true.

The reason this is here is because technical decorators haven't been accepted into ECMAScript yet (despite their wide adoption amongst many frameworks). As such its possible that this code that works today, might not be supported in the next release. Because of this risk we a supply a warning anytime you use them unless otherwise acknowledged in a tsconfig file.

A sample tsconfig.json that might serve you looks like this:

{"compilerOptions":{"experimentalDecorators":true,//silences the error"allowJs":true,// includes .js files (not just .ts)"noEmit":true},"exclude":["node_modules"//exclude large folders with libs from project (it'll be faster)],"typeAcquisition":{"enable":true// helps fuel better js intellisense}}

Let me know if that causes any additional problems.

Post a Comment for "Visual Studio 2017 Javascript How To Set 'experimentaldecorators'"