sindresorhus
strict-import

https://github.com/sindresorhus/strict-import
Go to Github

Prevent `require` from searching upwards for required modules

https://github.com/sindresorhus/strict-import/issues/2Go to Github

FundedView inAdd an option to allow certain modules to search upwards#2

sindresorhuscreated this issue 13 days ago

I had the need to allow a specific module to require upwards, so I added a private option _allowedMethods in https://github.com/sindresorhus/strict-import/commit/64ac0d0530d5fe0f35bf33665f8e3ad16da6beb5. I made it private because I'm not totally happy with it. It only works for top-level imports. So you can allow require('a') to be searched upwards by including a in the option, but if a imports a module name b, there's no way to allow b specifically, other than allowing any module from a.

Context: https://github.com/lukechilds/hyperdex/commit/d54a47c921e053620a76c57c9e3534f4f2dbe42e

Logs

Amount funded

$40.00

Resolve this issue and earn $36.00

Fund this issue

Fund as

Payment method

Amount(USD)

Please sign in first to fund this issue

Sign in with

Pull requests

0

    Submit

    URL of your pull request

    Submit your pull request

    Please sign in first to submit a pull request

    Sign in with