Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on `(interface-name) [typescript/tslint]` rule?

Tags:

tslint

I get this tslint error, which I don't understand why. The interface does start with a capital letter.

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;
like image 277
martins Avatar asked Dec 12 '25 04:12

martins


1 Answers

The interface-name rule requires that all interfaces being with the capital letter I. This is to distinguish interfaces from classes (since an interface is not a value, but a class is). In your case, you could correct your code by naming your interface IProps.

like image 159
JKillian Avatar answered Dec 16 '25 00:12

JKillian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!