gpt4 book ai didi

javascript - 如何忽略 TS 错误 TS2339 : “property does not exist on value of type” with eslint

转载 作者:行者123 更新时间:2023-12-02 22:05:41 25 4
gpt4 key购买 nike

我的 React js 项目失败了,我多次遇到此错误:

The TS2339: property 'x' does not exist on value of type 'y'

我的 tsconfig.json 文件:

{
"compilerOptions": {
"jsx": "react",
"target": "es6",
"module": "esnext",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"outDir": "target/classes/static/app",
"lib": ["es2015", "es2017", "dom"],
"types": ["webpack-env", "jest"],
"allowJs": true,
"checkJs": false,
"baseUrl": "./",
"paths": {
"app/*": ["src/main/webapp/app/*"]
},
"importHelpers": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
"include": ["src/main/webapp/app", "src/test/javascript/spec"],
"exclude": ["node_modules"]
}

如何解决?

最佳答案

也许将此规则添加到 tsconfig 会有帮助

"noImplicitAnyForClassMembers": false

关于javascript - 如何忽略 TS 错误 TS2339 : “property does not exist on value of type” with eslint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59720806/

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