Skip to content
This repository was archived by the owner on May 24, 2019. It is now read-only.
This repository was 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

Description

@sbma44

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions