加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – WebStorm 2016.3错误:对装饰器的实验支持是一个在将

发布时间:2020-12-17 07:51:37 所属栏目:安全 来源:网络整理
导读:嗨更新到最新的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
嗨更新到最新的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服务”.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读