Closed brokentone closed 5 years ago
I am fine with changing this feature.
At the time it made sense to relay the last exit code of a previous run. In terms of the exit code representing whether or not the watch command failed is also an acceptable alternative.
@brokentone I believe this is fixed with the latest V5. I made a big overhaul on the way error codes are passed around as well as changed everything to async/await to help with some of the other issues you had reported previously.
Closing for now, but if this is still an issue I am willing to reopen it to discuss.
Environment
Basic Description of the problem
One of the features of this tool seems to be recording the last exit code from a full run and replaying that on the process exit: (https://github.com/rizowski/eslint-watch/blob/master/src/index.js#L25)
However, this is current inconsistent and I would argue even undesired behavior.
Undesired: The main process this tool is running is a watch of files. If it is successfully able to watch the files and report on them on changes, the process should succeed (exit with a 0 status). Since it is going reporting over longer periods of time, playing back an earlier child exit code is decoupled from the actual errant behavior, which is confusing.
Inconsistent: Right now, if you have no errors initially, but have the
--watch --changed
flags on, introduce an error in a file, you will see the error reported, then kill the process, you will exit with a code of 0, vs if you now restart and have the error initially, you will exit with a code of 1.Recommend error status from
eslint
is not passed through to main exit code.How to reproduce it
esw --watch --changed
Debug output: