typescript-vs-flowtype icon indicating copy to clipboard operation
typescript-vs-flowtype copied to clipboard

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

Open gajus opened this issue 6 years ago • 5 comments
trafficstars

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

gajus avatar Dec 06 '18 03:12 gajus

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

oriSomething avatar Dec 06 '18 05:12 oriSomething

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

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

gajus avatar Dec 06 '18 09:12 gajus

@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

oriSomething avatar Dec 06 '18 09:12 oriSomething

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.

niieani avatar Dec 06 '18 13:12 niieani

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

niieani avatar Nov 22 '19 16:11 niieani