flow icon indicating copy to clipboard operation
flow copied to clipboard

how to use flow efficiently?

Open timzaak opened this issue 10 years ago • 8 comments

All the workflow I use with flow is:

  1. code in webStorm 2.type flow in 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
  2. repeat step 2,3,4

if there have any methods to reduce the step 2 or 3?

timzaak avatar Mar 26 '16 04:03 timzaak

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 avatar Mar 26 '16 06:03 jeffmo

@jeffmo thanks. I will keep the issue open about a week, and then close it. Appreciate for anyone who share the method. :)

timzaak avatar Mar 26 '16 06:03 timzaak

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

jeffmo avatar Mar 26 '16 14:03 jeffmo

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 avatar Mar 27 '16 19:03 bcowgill

@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!

timzaak avatar Mar 28 '16 01:03 timzaak

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.

cprodescu avatar Mar 29 '16 08:03 cprodescu

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.

dsilva avatar Apr 20 '16 09:04 dsilva

Here is a flow plugin for jetbrains / webstorm: https://github.com/dsilva/webstorm-plugin-flow-typecheck

chrisblossom avatar Aug 19 '16 18:08 chrisblossom