Reputation: 5940
According to the documentation:
The root directory (where your .flowconfig lives) is automatically included.
And also:
Ignores are processed AFTER includes. If you include and ignore a file it will be ignored.
So, what if I want to specifically include just one or two directories in my root to be processed, and ignore everything else by default? Is there any way to do this?
Upvotes: 3
Views: 2007
Reputation: 5940
Just to add to Sam's helpful answer and to directly answer the question, I just wanted to mention that as of Flowtype 0.22.0 this is not possible. The root directory that you run flow from is always included by default, and ignores in the flowconfig are applied after includes, so there is no way to manually ignore everything and then include specific directories. However that's not very important since flow doesn't bother parsing files without the /* @flow */
annotation.
Upvotes: 0
Reputation: 1446
You don't mention why you want to ignore everything by default, but I'll assume you mean one of two things:
I only want to type check some files
Flow is designed for this use case. You need to add a /* @flow */
comment to the top of any file you want checked, so files that don't have that comment will not be checked by default.
(FWIW, If you did want to check everything, you can use the --all
flag.)
Flow was giving me errors for files that I don't want checked
After the 0.22, Flow no longer parses files unless they start with the @flow
comment. This change fixes a longstanding issue where Flow would complain about unsupported syntax in node_modules
for example.
Hope this helps!
Upvotes: 3