简体   繁体   中英

Is there an eslint rule for TypeScript error TS2345

Is there an eslint rule to check for the typescript error TS2345? For example when an interface does not have all the required values.

Argument of type '{ toValue: number; fieldName: number; }' is not assignable to parameter of type 'SomeConfig'.
  Property 'otherProp' is missing in type '{ toValue: number; fieldName: number; }' but required in type 'SomeConfig'.ts(2345)

so I got this error trying to use the Animated API when running react-native-web using Typescript. If that is your case, then I can confidently tell you that the solution to this is to set native driver to false. useNativeDriver: false

There is no eslint rule to check this error and for this error to be triggered a build of the TypeScript project is required. Adding "build": "tsc -p." to the "scripts" section of your package.json will allow you to run yarn build to display this error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM