Closed jscheid closed 3 years ago
Sorry I can't decide what is the best way now.
I think yarn config get pnpMode
is supported by yarn version 2.0.0-rc.30
and in the lower versions the command returns error(Usage Error: Couldn't find a configuration settings named "pnpMode"
).
With the following setup:
getYarnPnpifyedLocalPrettier
fails to find prettier because when it runs with directoryworkspace/child
the checks for.pnp.js
fail, because the.pnp.js
file lives in the workspace root. It then tries the parent directory (workspace root), but there's noprettier
dependency at that level, causing the following error:Error: Your application tried to access prettier, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
@asbish since you wrote the PnP code, do you have any thoughts on how to best fix this? One idea is to check for
package.json
instead of.pnp.js
and if found, runyarn config get pnpMode
to decide whether PnP is enabled, wdyt?