how to use flow efficiently?
All the workflow I use with flow is:
- code in webStorm
2.type
flowin the terminal 3.scroll the terminal scrollbar to the top of the lints(sometimes, i need to scroll repeatedly to get the right position) 4.correct error - repeat step 2,3,4
if there have any methods to reduce the step 2 or 3?
I like to use watch flow In one dedicated terminal to have a constant view of the state of flow. I think OSX doesn't ship with 'watch', but it's available via 'brew install watch' I believe
@jeffmo thanks. I will keep the issue open about a week, and then close it. Appreciate for anyone who share the method. :)
Also, I'm not super familiar with Webstorm, but ideally an IDE would call out to flow for you (see flow --json) and render flow errors inline. This should work just as easily as integrating a linter (like ESLint, for example) into the IDE
Nuclide does a really good job with this, for example
Webstorm has flow support now WebStorm 11 EAP, 142.5255: Flow support, npm scripts, JSX in TypeScript http://blog.jetbrains.com/webstorm/2015/09/webstorm-11-eap-142-5255/ To use Flow, go to Preferences and switch the JavaScript language version to Flow.
You can also open your package.json then right click to run npm scripts. Your flow output can show in the webstorm console window, but you cannot jump to the code there :(
What I do is use grunt with flow in my watch target npm install grunt-flow --save-dev
@bcowgill thanks.
Now, I open a terminal and run watch flow, and I have 2 displays. So it is perfect!
The support of Webstorm to flow still has some errors, may the next version would be better. :)
thanks!
For Sublime users, good flow integration is provided by packages SublimeLinter and SublimeLinter-flow. On save, flow runs and issues are highlighted. For non-trivial errors you'll still need to take a look at the terminal, but most issues will be easy to correct inline.
See https://youtrack.jetbrains.com/issue/WEB-16607 and https://youtrack.jetbrains.com/issue/WEB-14254 for progress on displaying errors found by Flow as red underlines in WebStorm's editor panel.
Here is a flow plugin for jetbrains / webstorm: https://github.com/dsilva/webstorm-plugin-flow-typecheck