Code coverage report for lib/tasks/jshint.js

Statements: 100% (8 / 8)      Branches: 100% (8 / 8)      Functions: 100% (1 / 1)      Lines: 100% (8 / 8)     

All files » lib/tasks/ » jshint.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201   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);
};