TypeScript错误TS2345是否存在eslint规则

时间:2020-05-08 00:51:45

标签: typescript eslint

是否存在eslint规则来检查打字稿错误TS2345?例如,当一个接口没有所有必需的值时。

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)

2 个答案:

答案 0 :(得分:0)

所以我在使用Typescript运行react-native-web时尝试使用Animated API时遇到此错误。 如果是这种情况,那么我可以自信地告诉您解决方案是将本机驱动程序设置为false。 useNativeDriver: false

答案 1 :(得分:0)

没有eslint规则可以检查此错误,并且要触发此错误,必须构建TypeScript项目。新增中 “ build”:“ tsc -p”。转到package.json的“脚本”部分,即可运行yarn build来显示此错误。