diff --git a/src/index.js b/src/index.js index fe04fa973..57565f14c 100644 --- a/src/index.js +++ b/src/index.js @@ -54,7 +54,7 @@ cosmiconfig('lint-staged', { if (tasks.length) { new Listr(tasks, { concurrent }).run().catch((error) => { - console.error(error) + console.error(error.message) process.exit(1) }) } diff --git a/src/runScript.js b/src/runScript.js index a2848078a..df38305ad 100644 --- a/src/runScript.js +++ b/src/runScript.js @@ -17,13 +17,12 @@ module.exports = function runScript(commands, pathsToLint, packageJson, gitDir) resolve(`${ linter } passed!`) }) .catch((err) => { - reject(` + reject(new Error(` 🚫 ${ linter } found some errors. Please fix them and try committing again. ${ err.stderr } ${ err.stdout } -` - ) +`)) }) }) } catch (err) {