fix: print warnings to stderr (#8342)

This commit is contained in:
Munif Tanjim authored and GitHub committed 2024-08-04 01:53:52 +02:00
1 parent d20eed33ab
commit 98c8bd69cb
3 files changed
+11 -23

No files matched your search

+2 -3
View File
@@ -28,9 +28,8 @@ export async function getConfig (
delete config.reporter // This is a silly workaround because @pnpm/core expects a function as opts.reporter
}
// The warning should not be printed when --json is specified
if (warnings.length > 0 && !cliOptions.json) {
console.log(warnings.map((warning) => formatWarn(warning)).join('\n'))
if (warnings.length > 0) {
console.warn(warnings.map((warning) => formatWarn(warning)).join('\n'))
}
return config