Contribution
Describe the user story
I often register npm-scripts in package.json that run some static analysis. For example, lint:tsc to run tsc, lint:eslint to run eslint and lint:prettier to run prettier.
I also register an npm-script that runs them in batches. The script is run on CI.
I now use npm-run-all for this script and write it as follows.
{
"scripts": {
"lint": "run-s --continue-on-error lint:*",
"lint:eslint": "eslint .",
"lint:tsc": "tsc --noEmit",
"lint:prettier": "prettier --check ."
}
}
I would like to do this same thing with pnpm run:
{
"scripts": {
"lint": "pnpm run --sequential '/lint:[^:]+/'",
"lint:eslint": "eslint .",
"lint:tsc": "tsc --noEmit",
"lint:prettier": "prettier --check ."
}
}
However, the script seems to abort execution of the other sub-scripts as soon as any of them terminate with an error. For example, if lint:tsc exits with an error, it may interrupt lint:eslint or lint:prettier before they complete.
This behaviour does not fit my use case. I want to find more problems in one run of the lint script.
example: https://github.com/mizdra/pnpm-feature-request-continue-on-error
Describe the solution you'd like
Add the --continue-on-error option to pnpm run, like npm-run-all. This option allows other scripts to continue running even if a sub-script exits. When all scripts have completed, the parent script is terminated with an error.
This option should work whether the sub-scripts are executed in parallel (--no-sequential) or in series (--sequential).
Describe the drawbacks of your solution
When an error occurs in two sub-scripts, it is not clear what the error code of the parent script will be. Should it be the error code of either sub-script? Or should it be a different error code? The npm-run-all implementation might help with this, but I don't know about it yet.
Describe alternatives you've considered
None.
Contribution
Describe the user story
I often register npm-scripts in package.json that run some static analysis. For example,
lint:tscto run tsc,lint:eslintto run eslint andlint:prettierto run prettier.I also register an npm-script that runs them in batches. The script is run on CI.
I now use npm-run-all for this script and write it as follows.
{ "scripts": { "lint": "run-s --continue-on-error lint:*", "lint:eslint": "eslint .", "lint:tsc": "tsc --noEmit", "lint:prettier": "prettier --check ." } }I would like to do this same thing with pnpm run:
{ "scripts": { "lint": "pnpm run --sequential '/lint:[^:]+/'", "lint:eslint": "eslint .", "lint:tsc": "tsc --noEmit", "lint:prettier": "prettier --check ." } }However, the script seems to abort execution of the other sub-scripts as soon as any of them terminate with an error. For example, if
lint:tscexits with an error, it may interruptlint:eslintorlint:prettierbefore they complete.This behaviour does not fit my use case. I want to find more problems in one run of the
lintscript.example: https://github.com/mizdra/pnpm-feature-request-continue-on-error
Describe the solution you'd like
Add the
--continue-on-erroroption topnpm run, like npm-run-all. This option allows other scripts to continue running even if a sub-script exits. When all scripts have completed, the parent script is terminated with an error.This option should work whether the sub-scripts are executed in parallel (
--no-sequential) or in series (--sequential).Describe the drawbacks of your solution
When an error occurs in two sub-scripts, it is not clear what the error code of the parent script will be. Should it be the error code of either sub-script? Or should it be a different error code? The npm-run-all implementation might help with this, but I don't know about it yet.
Describe alternatives you've considered
None.