linter-flow icon indicating copy to clipboard operation
linter-flow copied to clipboard

Support for options.all=true

Open tonyxiao opened this issue 9 years ago • 4 comments

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.

tonyxiao avatar Oct 25 '16 21:10 tonyxiao

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

stevenla avatar Nov 10 '16 22:11 stevenla

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?

Arcanemagus avatar Dec 08 '16 00:12 Arcanemagus

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.

Agontuk avatar Jan 17 '17 06:01 Agontuk

@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

git-jiby-me avatar Jan 28 '17 07:01 git-jiby-me