Closed atsu85 closed 7 years ago
I'll send a PR shortly
Couldn't you alternatively use the .tsint
property of each file?
https://github.com/panuhorsmalahti/gulp-tslint/blob/master/index.ts#L160
@panuhorsmalahti, thanks, I didn't think about it initially (I have no experience with Node streams and Gulp plugins). The solution i ended up with needed following change:
Instead of:
.pipe(tslint.report({
emitError: false, // make sure "end" event is emitted even in case of error
onReportCallback: (info) => { // <------------- THIS IS WHAT I NEED
errorHelper.errorHandler(info.totalReported); // increments error counter by totalReported
},
}))
I used:
.pipe(tslint.report({
emitError: false,
}))
.on('data', function(data) {
if (data.tslint.failureCount) {
errorHelper.errorHandler();
}
})
I'd like to have a callback from gulp-tslint that would get called when the plugin reports errors, so I could show GUI popup message when gulp-tslint detects problems (and when they get fixed)
Note, that I don't want to create my own custom error formatter, I'd like to use whatever error formatter independently of the callback.
Here is an example of what I'd like: