gpt4 book ai didi

angular - 如何摆脱 Eclipse 中 angular4 项目的 experimentalDecorators 警告

转载 作者:搜寻专家 更新时间:2023-10-30 21:50:58 24 4
gpt4 key购买 nike

我刚刚使用 anglar4 cli 创建了一个新项目,并开始出现以下错误。

Experimental support for decorators is a feature that is subject to change in a future release. Set 
the 'experimentalDecorators' option to remove this warning.

对于每个注释。

我之前没有使用过 ng cli,所以我没有看到任何类似的警告。

我检查我的 tsconfig,

{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"module": "commonjs",
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"node_modules/@types"
],

"exclude":
[
"node_modules",
"**/*.spec.ts"
],

"lib": [
"es2016",
"dom"
]
}
}

没什么特别的。

如何在 Eclipse 中删除 angular4 项目的警告?这是非常烦人的误报。

我在 Eclipse 中使用了 typescript 插件。

最佳答案

I faced similar problem & Adding "allowJs": true, in the CompilerOptions in tsconfig.json solved the issue. I hope it helps others.

添加上面后我的 tsconfig.json 如下所示。

{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowJs": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}

关于angular - 如何摆脱 Eclipse 中 angular4 项目的 experimentalDecorators 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44617664/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com