Blog describes what I believe is an optimal development setup with Flow. It details using Visual Studio Code IDE with Flow.
Blogger: V. Keerti Kotaru . Author of Angular Material book
Flow is a static type checker. For an introductory blog on Flow's type checking, read my earlier blog.
Optimal way to run type checking with Flow.
|Figure 1: Flow process in the background|
Flow will start a process (if not running already) and type checks only the JS files annotated with // @flow. Then-on, next time flow command is run, type checking will be incremental and hence it will be better performing.
However, if you need to type check all files use flow check --all. It will start a new process and type checks all files (irrespective // @flow comment is written or not). As it starts a new process, even the ones not modified after previous type checking are checked again. It is not advisable to run every time with the --all option.
For Flow's type checking, I'm currently using "Flow Language Support" published by Flowtype . Follow this link to view and download the extension.
|Figure 2: VS Code's extension for Flow shows errors with type checking|
Go to Preferences >> Workspace Preferences (or User Preferences) and provide the configuration in settings.json.
Note: Updating the configuration in Workspace preferences would skip JS and Typescript checking in only the current project. Updating it in User Settings will skip for all projects.
The workspace settings could be checked-in to git or any other source control. The settings are saved in settings.json under .vscode folder at the root directory. This will allow all developers on the project obtain settings by default. We don't have to do it on each machine explicitly.
References and useful links.VS Code extension for Flow - https://marketplace.visualstudio.com/items?itemName=flowtype.flow-for-vscode
Documentation on starting a new Flow project - https://flowtype.org/docs/new-project.html#_