facebook / flow

Adds static typing to JavaScript to improve developer productivity and code quality.
https://flow.org/
MIT License
22.1k stars 1.86k forks source link

CLI allow to display only errors/warnings instead of warnings + errors #8667

Open SimonGodefroid opened 3 years ago

SimonGodefroid commented 3 years ago

Proposal

Make a CLI option to list only errors or only warnings.

npx flow --show-only-errors => this would be a --show-all-errors but without the warnings

npx flow --show-only-warnings => this would be a --show-all-errors but with errors instead of warnings

Use case

I am migrating from 0.133.0 to 0.151.0, needless to say I have a lot of warnings and errors.

However I can live with warnings for now and am just trying to fix errors first.

If I run

npx flow

I see errors + warnings.

I can run

npx flow --show-all-errors

It's annoying not to be able to fix each kind separately.

Thanks for considering.

yanndinendal commented 3 years ago

For anyone else reading; here is what I do as a workaround:

(flow --show-all-errors --color=always | sed '/Warning ---/q') 2> /dev/null