jscs-dev/gulp-jscs

Append errors to file object through a namespace

Closed this issue · 1 comments

As seen at https://github.com/spenceralger/gulp-jshint#results, gulp-jshint puts some of its results on the file object so that errors can be handled later in the gulp process. I am using this feature in conjunction with gulp-notify to create desktop notifications when linting errors are found. I'd like to be able to do the same for code style errors.

Ideally, I'd like something very similar to what jshint uses:

file.jscs.success = true
file.jscs.errors = []
file.jscs.rules = {} // shows the rules which were loaded from the config file or passed in as options

I was looking to do the same thing. Instead of saving the errors up and dumping them at the end, they could be attached to the main file object then flow downstream. A lot of gulp-jscs use-cases I've found end up suppressing jscs errors so watches don't break, having later per-file access to those errors later on would be helpful.