Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only set error codes when they are non zero (#7363)
* fix: only set error codes when they are non zero I'm working on an internal CLI that runs jest, eslint, and sasslint all in one single process for our frontend team to run from their `package.json`'s Aka something like, `"test": "cli test"`. The code `process.on('exit', () => (process.exitCode = code));` adds a listener that is overriding the exit codes we're setting so that when jest is successful, and eslint or sasslint fail, I can't exit with a failing code. Therefore our CI's are reporting as passed even though the linting fails. It seems as though there's no reason to actually set the error code at all unless it's non-zero? Let me know what the thoughts here are. I can come back in and add more, add some additional tests, etc if this looks like an ok change. Thanks! * fix: check if error code is a non-zero number * chore: update changelog * Update CHANGELOG.md * fix: remove whitespace * move the check inside the process exit handler * add a breaking change notification
- Loading branch information