({interface-name)[typescript / tslint]`规则出错?

mar*_*ins 1 tslint

我收到这个tslint错误,我不明白为什么。该界面确实以大写字母开头。

29 col 11 error| interface name must start with a capitalized I (interface-name) [typescript/tslint]

S> 29 interface Props {
   30   answerQuestion: (answerQuestion: AnswerQuestion) => void;
Run Code Online (Sandbox Code Playgroud)

JKi*_*ian 6

interface-name规则要求所有接口都必须使用大写字母I。这是为了区分接口和类(因为接口不是值,而是类)。您可以通过命名interface来更正代码IProps