"flow check-contents" and "flow suggest"

696 views Asked by At

Why does "flow check-contents" require use of < to redirect a file into it, but "flow suggest" does not? It seems like check-contents should assume the command-line arguments are file paths to be checked.

1

There are 1 answers

0
Marshall Roch On

flow check-contents < filename.js checks the whole project, including filename.js. the most common use case is editor integration, where you want to check the project against an unsaved version of a file; in that case you'd do flow check-contents filename.js < unsaved editor buffer, which tells flow to temporarily replace the contents of filename.js and recheck the whole project.

if you're piping in a saved file, you can alternatively run flow (aka flow status) instead of piping it in, since that also checks the entire project.