Open isaacs opened 3 years ago
Also, what happens if the project config sets global=true
?
Is global
just something that shouldn't ever be set by a config file?
Should project config be allowed to set userconfig/globalconfig? The userconfig setting the globalconfig is a thing I know some users depend on, and seems much less hazardous.
The point is: if "global=true + loaded a project config" is a combination we don't want, then there's some more prickly surface area to cover here.
What / Why
https://github.com/npm/config/pull/23 will make npm not load the project config if global=true in cli or env.
However, if
global=true
is set in the userconfig, then the project config is still loaded.If this is an unsupported case, then it should be documented. If not, then... I guess project config would have to be unloaded, since it can change the location of the userconfig? So, you could have a project config that sets
userconfig=/path/to/userconfig/a
, and then/path/to/userconfig/a
containsglobal=true
, which means we shouldn't load the project config, so now we loaded the wrong userconfig?Maybe project config shouldn't be able to set the userconfig/globalconfig options?
Failing test showing the issue (but really, this just highlights that it's a weird paradox loop, not that this test should be made to pass, necessarily)