![](/img/trans.png)
[英]How to disable javascript extensions in Visual Studio 2017?
[英]Visual Studio 2017 Javascript How to set 'experimentaldecorators'
你需要一个tsconfig.json
,将experimentalDecorators
标志设置为true
。
这是因为技术装饰器尚未被ECMAScript接受(尽管它们在许多框架中被广泛采用)。 因此,今天可能运行的代码可能在下一版本中不受支持。 由于存在这种风险,我们会在您使用它们时随时提供警告,除非在tsconfig文件中另行确认。
可能为您提供服务的示例tsconfig.json
如下所示:
{
"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
}
}
如果这会导致任何其他问题,请告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.