| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1 1 14 14 14 13 14 14 | var jshint = require('jshint').JSHINT;
exports.jshint = function (options, blob, done) {
options = options || {};
var source = blob.result,
config = options.config,
callback = options.callback,
result = jshint(source, config),
errors = null,
linted = null;
if (!result) {
errors = jshint.errors;
}
linted = errors ? new blob.constructor(blob, { jshint: errors }) : blob;
done(callback ? callback(linted) : null, linted);
};
|