microsoft / TypeScript-React-Starter

A starter template for TypeScript and React with a detailed README describing how to use the two together.
MIT License
11.09k stars 1.21k forks source link

Compile Error: interface name must start with a capitalized I #171

Open Yang09701194 opened 6 years ago

Yang09701194 commented 6 years ago

I'm building my-app/src/components/Hello.tsx, and got this error:

(4,18): interface name must start with a capitalized I

image

.

and I need to fix it by adding 'I' before 'Props' to 'IProps':

export interface IProps {
    name: string;
    enthusiasmLevel?: number;
}

function Hello({name, enthusiasmLevel = 1} : IProps){

I think this error will influence all the place of interface name,

should I just update this part of README.md using PR first?

Yang09701194 commented 6 years ago

I've seen that IProps is fixed in #172 ,but seems few places possibly need fix, I've not finished reading README.md, maybe I'll give it some check when I finish.

vincentwongso commented 6 years ago

Will be good if this can be fixed, it might stumble many other newcomers.

Yang09701194 commented 6 years ago

Sorry I am working on my next job interviews these weeks, so I can't spend time on this issue recently, if anyone is enthusiastic to fix it is welcome.

lc3t35 commented 6 years ago

This can be solved with these rules (that solves also other problems ...) in your tslint.json

"rules": {
    "object-literal-sort-keys": false,
    "interface-name": false,
    "member-access": [true, "no-public"],
    "ordered-imports": false
  },
wedaren commented 5 years ago

https://github.com/palantir/tslint/issues/3265

raitalharehman commented 5 years ago

This can be solved with these rules (that solves also other problems ...) in your tslint.json

"rules": {
    "object-literal-sort-keys": false,
    "interface-name": false,
    "member-access": [true, "no-public"],
    "ordered-imports": false
  },

Not working now...!

msingh025 commented 5 years ago

{ "defaultSeverity": "error", "extends": [ "tslint:recommended" ], "jsRules": {}, "rules": { "class-name": false, "trailing-comma": [ false ], "no-console": false, "only-arrow-functions": false, "interface-name": [true, "never-prefix"] }, "rulesDirectory": [] } Update your interface rule as above, It seems to working