linter-flow
linter-flow copied to clipboard
Support for options.all=true
https://flowtype.org/docs/advanced-configuration.html#options
It's possible to turn flowtype on for all files by default in a repo.
However linter-flow does not seem to understand that and therefore does not highlight issues in editor.
The option enableAll doesn't get respected at all. I still have to include // @flow at the top of my files for the linter to catch them
It seems that since this issue was filed flow itself has changed enough that this issue's text makes no sense (there is no enableAll option in this package or in flow from what I can see).
That being said, it seems that the flow documentation implies it runs on all files by default now, I'm not entirely sure what that means or how to handle it here. Should we just keep the current scope list and remove the requirement that the file contain @flow?
As far as I understand, running flow only checks files with @flow annotation. To enable checking without annotation, you have to run flow --all. I think there should be enableAll option which, if enabled, will run flow with --all flag.
@Arcanemagus flow uses the .flowconfig to define if all files needs to be checked or not. The problem in flow-linter is this check inside lib\index.js
// Is flow enabled for current file?
if (!fileText || fileText.indexOf('@flow') === -1) {
return Promise.resolve([]);
}
basically flow-linter just cuts off if file doesn't have the annotation, we can simply remove this check, as flow will automatically from .flowconfig decide if it needs to run on all files or not.
I will try to send a pull request when i have some time, but removing this check manually in my file system, fixes the problem