Lint-staged: lint-stage doesn't print any task internal console outputs.

Created on 15 Feb 2019  路  7Comments  路  Source: okonet/lint-staged

Description

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.

Steps to reproduce

package.json

  "lint-staged": {
    "package-lock.json": [
      "node scripts/myCustomScript.js"
    ],
  },

myCustomScript.js
console.log('This never gets printed');

Debug Logs


expand to view

COPY THE DEBUG LOGS HERE

Environment

  • OS: Windows 10
  • Node.js: 11.4.0
  • lint-staged: 8.1.0

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);**

All 7 comments

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);**

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.

Was this page helpful?
0 / 5 - 0 ratings