I would like to see the full output generated by the npm scripts I have configured in the "lint-staged" section. At the moment, I can only see the output generated by lint-stage itself but nothing from the subtasks.
package.json
"lint-staged": {
"package-lock.json": [
"node scripts/myCustomScript.js"
],
},
myCustomScript.js
console.log('This never gets printed');
COPY THE DEBUG LOGS HERE
lint-staged: 8.1.0Piping exaca > process.stdout in execLinter function from resolveTasksFn solves the issue for me but not sure about the side effects it could generate.
return execa(bin, binArgs, { ...execaOptions })**.stdout.pipe(process.stdout);**
I can confirm this behavior in Debian as well. Might be related with https://github.com/okonet/lint-staged/issues/161
This still seems to be an issue on 10.0.8. Is there any update or plans to support it?
This is because of the default renderer from Listr, there's really nothing we could do other than changing that.
One problem is that lint-staged executes tasks in parallel by default, so the console output would be mixed.
Same issue here, lint-staged just swallow my internal task console output, that's not good for me.
You can now use the --verbose flag to show all task output after the tasks have finished. Be sure to update to the latest version.
I'll close this issue but feel free to re-open if it doesn't solve your issue.
It's my fault, I just called process.exit() in my internal scripts, change to process.exitCode do help,after that all my console output displayed completely.
Most helpful comment
Piping exaca > process.stdout in execLinter function from resolveTasksFn solves the issue for me but not sure about the side effects it could generate.
return execa(bin, binArgs, { ...execaOptions })**.stdout.pipe(process.stdout);**