From 5bd24bc0efc2006bd5e2cff22e11d4da33c8686d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Fri, 3 Dec 2021 10:49:50 +0800 Subject: [PATCH] fix: `npm init @eslint/config` output --- bin/eslint.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/eslint.js b/bin/eslint.js index 18a084c4a83e..b66eb687be11 100755 --- a/bin/eslint.js +++ b/bin/eslint.js @@ -130,10 +130,11 @@ ${message}`); const spawn = require("cross-spawn"); const npmProcess = spawn.sync("npm", ["init", "@esllint/config"], { encoding: "utf8" }); - const error = npmProcess.error; - if (error) { - console.error(error.message); + if (npmProcess.status === 0) { + console.log(npmProcess.stdout); + } else { + console.error(npmProcess.stderr); } return; }