gpt4 book ai didi

TypeScript 短绒警告 : no-unused-variable is deprecated; but I'm not using this config

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

今天我在 3 个月后刷新的项目中看到此警告。

no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.

但是我的tsconfig.json好像没有用到这个

{
"compilerOptions": {
"lib": ["es6"],
"module": "commonjs",
"noImplicitReturns": true,
"outDir": "lib",
"sourceMap": true,
"target": "es6",
"allowJs" : true
},
"compileOnSave": true,
"include": [
"src"
]
}

可能它是任何先前配置中隐含的配置。

你能告诉我如何修复它吗?

如果有用

$ node -v
v10.3.0
$ npm -v
6.1.0

这些 devDependencies 与我的 package.json 中的类型脚本相关

"devDependencies": {
...
"tslint": "^5.11.0",
"typescript": "^2.9.1"
...
},

最佳答案

no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.

  1. 从您的 or 依赖项中删除已弃用的 no-unused-variable tslint.json 文件。

  2. 在您的文件中指定以下编译器选项 tsconfig.json 文件。

"compilerOptions": {
"noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedParameters": true /* Report errors on unused parameters. */
}

关于TypeScript 短绒警告 : no-unused-variable is deprecated; but I'm not using this config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51621162/

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