[英]how Ignore TS Errors TS2339: “property does not exist on value of type” with eslint
我的 React js 项目失败了,我多次收到此错误:
TS2339:属性“x”不存在于“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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.