我的 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/