WebStorm 2016.3 error: experimental decorator support is a feature that may be changed in a future version

Hi, updated to the latest WebStorm, and now I get this error:

Error:(52, 14) TS1219:Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning. 

But in my tsConfig experimentalDecorators set to true:

 { "version": "1.5.0", "compilerOptions": { //..., "experimentalDecorators": true, // <======== HERE //..., }, "files": [ //... ], "exclude": [ "node_modules" ] } 
+8
angular webstorm phpstorm meteor typescript
source share
1 answer

WS2016.3 applies configuration settings to a file only if the file is included in the "files" or "include" section of tsconfig.json. [ More information about tsconfig.json ]

Thus, config should include all the project files (or if you have several parts of the application, you can have several tsconfig.json files). Otherwise, the typescript service uses typescript parameters for the file.

Preferred Solution

Your tsconfig.json should be:

 { "version": "1.5.0", "compilerOptions": { "target": "es5", "module": "commonjs", "noImplicitAny": false, "removeComments": true, "noLib": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, "listFiles": true, "isolatedModules": false, "moduleResolution": "node", "suppressImplicitAnyIndexErrors": true }, "include": [ "typings/thera/thera.d.ts", "typings/browser.d.ts", "typings/main.d.ts", "typings/meteor.d.ts", "typings/meteor_server.d.ts", "your_app_directory/**/*" ], "exclude": [ "node_modules" ], "compileOnSave":false //not required but is suggested for meteor projects } 

Another solution

You can specify the default parameters in the typescript settings (the track changes parameter should be unchecked if you do not want automatic compilation):

TypeScript Settings

Note. . If you do not like the new behavior, you can disable the integration of typescript services in "File | Preferences | Languages ​​and Frames | TypeScript" β†’ "Use typescript service".

+17
source share

All Articles