简体   繁体   English

Typescript 在 VScode 中工作,但 eslint 为推断类型发出 react/prop-types 错误

[英]Typescript working in VScode, but eslint emitting react/prop-types error for inferred types

In VScode it works fine because the type can be inferred from LeadInfo .在 VScode 中它可以正常工作,因为可以从LeadInfo推断出类型。 在此处输入图像描述

However, Eslint is emitting errors of missing props validation但是,Eslint 发出missing props validation的错误在此处输入图像描述

By the way, the Column is from React-table and we already followed the react-table suggested setup from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table顺便说一句, Column来自React-table ,我们已经按照https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table中的react-table建议设置

Turn off the react/prop-types rule in your eslint config, it doesn't make much sense having on if your using TS在你的 eslint 配置中关闭react/prop-types规则,如果你使用 TS 没有多大意义

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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