[英]Visual Studio Code 'experimentalDecorators' Issue for Angular Build
I am having an issue with VSC where all my typescript classes are triggering the intellisense and coming up with this warning: 我在VSC上遇到问题,我的所有打字稿类都触发了智能感知并提出以下警告:
"[ts] Experimental support for is a feature that is subject to change in a future build. Set the 'experimentalDecorators' option to remove this warning."
“ [ts]的实验性支持是一项功能,该功能在将来的版本中可能会更改。设置'experimentalDecorators'选项可删除此警告。”
This is a documented issue, with various fixes documented in these posts: 这是一个已记录的问题,这些帖子中记录了各种修复程序:
However I am using a now more recent version of VSC (it was actually me updating it today that seems to have triggered something), and with that none of the solutions mentioned here seem to work. 但是,我使用的是VSC的最新版本(实际上是我今天对其进行了更新,似乎已经引起了某些问题),因此此处提到的解决方案似乎都无效。
I have: 我有:
Here's my current tsconfig.json 这是我当前的tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom"
]
}
}
I am using VSC version 2.3.2 and my TS version in my package.json is set to "typescript": "~2.2.0". 我正在使用VSC版本2.3.2,并且package.json中的TS版本设置为“ typescript”:“〜2.2.0”。
Is there something here I'm missing? 这里有什么我想念的吗?
this is what what worked for me:
tsconfig.js (relevant part):
{
"compilerOptions": {
...
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"outDir": "dist",
...
},
"include": [
"src/index.ts"
]
}
Here is the full file: 这是完整的文件:
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"strictNullChecks": true,
"allowJs": true,
"lib": [
"es6"
],
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"sourceMap": true,
"target": "es6"
},
"include": [
"src/db/**/*.ts",
"src/index.ts"
]
}
Basically I just added the include attribute instead of using the files attribute. 基本上,我只是添加了include属性,而不是使用files属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.