How do I disable the following error in VS2015?
TS1219 Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
I'm trying to use Angular2 annotations. I tried adding the following manually to the project file with no luck:
<TypeScriptExperimentalDecorators>True</TypeScriptExperimentalDecorators>
I've also install the TypeScript 1.5.0 beta extension.
Decorators provide a way to add both annotations and a meta-programming syntax for class declarations and members. Decorators are a stage 2 proposal for JavaScript and are available as an experimental feature of TypeScript. NOTE Decorators are an experimental feature that may change in future releases.
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option `to remove this warning.
A “decorator” is a special kind of declaration which its expression is evaluated during runtime and it can be attached to a class, method accessor, property, or parameter.
Visual Studio 2015 supports tsconfig files starting with Typescript version 1.8. Create tsconfig.json file at the root of your project and add experimentalDecorators
compiler option.
Example:
{ "compileOnSave": true, "compilerOptions": { "module": "commonjs", "sourceMap": true, "experimentalDecorators": true } }
For older versions:
https://github.com/Microsoft/TypeScript/issues/3934
If you have a project file, tsconfig will not be honored. the project file takes precedence. We are still flushing the integration story between a VS project and a tsconfig as you can specify compiler options in both.
so to disable the error message, right-click on project file, unload project, then right-click edit the project file, At the end of the file there should be a config section, add:
<PropertyGroup Condition="'$(Configuration)' == 'Debug'"> .... <TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators> </PropertyGroup>
save and reload.
You may also need TypeScriptEmitDecoratorMetadata to map --emitDecroatorMetadata
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