嗨更新到最新的WebStorm,我现在收到此错误:
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.
但在我的tsConfig中,experimentalDecorators设置为true:
{ "version": "1.5.0","compilerOptions": { //...,"experimentalDecorators": true,// <======== HERE //...,},"files": [ //... ],"exclude": [ "node_modules" ] }
仅当文件包含在“files”或“include”tsconfig.json部分中时,WS2016.3才会将配置设置应用于文件. [
More info about tsconfig.json]
所以配置必须包含所有项目文件(或者如果你有几个部分的应用程序,你可以有几个tsconfig.json文件).否则,typescript服务使用该文件的默认打字稿选项.
首选解决方案
你的tsconfig.json应该是:
{ "version": "1.5.0","compilerOptions": { "target": "es5","module": "commonjs","noImplicitAny": false,"removeComments": true,"noLib": false,"emitDecoratorMetadata": 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 }
另一解决方案
您可以在TypeScript设置中指定默认选项(如果您不想自动编译,则应取消选中跟踪更改选项):
注意:如果您不喜欢新行为,可以在“文件|设置|语言和框架| TypeScript” – >中禁用打字稿服务集成. “使用TypeScript服务”.