Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell flow to typecheck every file, not just the ones with /* flow */?

Tags:

flowtype

In the official examples they always have /* @flow */ at the top of the page. Now that's nice and helpful for an existing project, where I want to opt-in to flow for each file. Building a new project from scratch I would like to just have flow type checking everywhere, without having to type /* @flow */ every time. Is it possible?

like image 466
Capaj Avatar asked Mar 14 '17 21:03

Capaj


1 Answers

Assuming you have a .flowconfig or you can make one, you can add

[options]
all=true

in there.

Note that this is literally all files, so that will also include random files in node_modules. Another alternative would be to use @flow and just use a lint rule like require-valid-file-annotation for ESLint.

like image 99
loganfsmyth Avatar answered Sep 19 '22 21:09

loganfsmyth