Skip to content
This repository has been archived by the owner on May 24, 2019. It is now read-only.

including content from node_modules is impossible without a nonintuitive exclude #60

Open
sbma44 opened this issue Feb 14, 2018 · 1 comment

Comments

@sbma44
Copy link

sbma44 commented Feb 14, 2018

The test mock framework I'm working on needs to use flow-remove-types to include some components of a project in its node_modules. From the docs it seems like I should be able to accomplish this with:

require('flow-remove-types/register')({ includes: /.*?\/mapbox-gl\/src\/.*/ });

But this doesn't work because of the logic in https://github.com/flowtype/flow-remove-types/blob/769385af04e8151579701d3c3a1d450a2db3b021/register.js#L49 -- the default exclusion value breaks my inclusion criterion. Instead I have to do something like:

require('flow-remove-types/register')({ includes: /.*?\/mapbox-gl\/src\/.*/, excludes: { test: function() { return false; }} });

This is workable but unintuitive. I'd like to suggest dividing the logic into more levels of priority:

explicit exclusion criteria > explicit inclusion criteria > default exclusion criteria > default inclusion criteria

@motiz88
Copy link
Contributor

motiz88 commented Feb 15, 2019

I wonder if this would be solved by migrating to pirates (#62).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants