niieani / typescript-vs-flowtype

Differences between Flowtype and TypeScript -- syntax and usability

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flowtype has extensive linting support through ESLint eslint-plugin-flowtype

gajus opened this issue · comments

Might worth including in comparison that unlike TypeScript (?), FlowType has extensive linting support through ESLint https://github.com/gajus/eslint-plugin-flowtype plugin.

Why saying so? I use https://github.com/bradzacher/eslint-plugin-typescript at work and it works great

@oriSomething The last I checked that project it didn't have many rules.

Now the two projects seem comparable (26 vs 34 rules).

@gajus More to this compare:

  • A rule like use-flow-type isn't relevant to TS
  • There is a rule of valid-syntax which is overcome a Babylon bug. Not related to TS
  • There are 7 styling rules at Flow plugin comparing to 1 at TS plugin which all of them can be (and should) replaced by prettier
  • And more rules in the Flow plugin, that the counter to them, better used in already exist config of tsconfig.json

So, There is no real different here. It's just a personal preference

I'm happy to add a PR with a comparison that takes into account all of the nuances that @oriSomething pointed out. On that note, keep in mind TypeScript also has tslint, so eslint isn't the only option, plus flow has some built-in lints.

Btw. eslint now has type-based linting for TypeScript. It's still worth mentioning/comparing, but I think these are on par now.