plugins/lint.js
function (file, errors, options) {
      var reports = []
        , content = file.content.split('\n');

      errors.forEach(function error (err) {
        // some linters don't return the location -_-
        if (!err.line) return reports.push(err.message.grey, '');

        var start = err.line > 3 ? err.line - 3 : 0
          , stop = err.line + 2
          , range = content.slice(start, stop)
          , numbers = _.range(start + 1, stop + 1)
          , len = stop.toString().length;

        reports.push('Lint error: ' + err.line + ' col ' + err.column);
        range.map(function reformat (line) {
          var lineno = numbers.shift()
            , offender = lineno === err.line
            , inline = /\'[^\']+?\'/
            , slice;

          // this is the actual line with the error, so we should start finding
          // what the error is and how we could highlight it in the output
          if (offender) {
            if (line.length < err.column) {
              // we are missing something at the end of the line.. so add a red
              // square
              line += ' '.inverse.red;
            } else {
              // we have a direct match on a statement
              if (inline.test(err.message)) {
                slice = err.message.match(inline)[0].replace(/\'/g, '');
              } else {
                // it's happening in the center of things, so we can start
                // coloring inside the shizzle
                slice = line.slice(err.column - 1);
              }

              line = line.replace(slice, slice.inverse.red);
            }
          }

          reports.push('  ' + pad(lineno, len) + ' | ' + line);
        });

        reports.push('');
        reports.push(err.message.grey);
        reports.push('');

      });

      // output the shizzle
      reports.forEach(function output (line) {
        this.logger.error(line);
      }.bind(this));
    }
function (file, errors, options) {
      var reports = []
        , content = file.content.split('\n');

      errors.forEach(function error (err) {
        // some linters don't return the location -_-
        if (!err.line) return reports.push(err.message.grey, '');

        var start = err.line > 3 ? err.line - 3 : 0
          , stop = err.line + 2
          , range = content.slice(start, stop)
          , numbers = _.range(start + 1, stop + 1)
          , len = stop.toString().length;

        reports.push('Lint error: ' + err.line + ' col ' + err.column);
        range.map(function reformat (line) {
          var lineno = numbers.shift()
            , offender = lineno === err.line
            , inline = /\'[^\']+?\'/
            , slice;

          // this is the actual line with the error, so we should start finding
          // what the error is and how we could highlight it in the output
          if (offender) {
            if (line.length < err.column) {
              // we are missing something at the end of the line.. so add a red
              // square
              line += ' '.inverse.red;
            } else {
              // we have a direct match on a statement
              if (inline.test(err.message)) {
                slice = err.message.match(inline)[0].replace(/\'/g, '');
              } else {
                // it's happening in the center of things, so we can start
                // coloring inside the shizzle
                slice = line.slice(err.column - 1);
              }

              line = line.replace(slice, slice.inverse.red);
            }
          }

          reports.push('  ' + pad(lineno, len) + ' | ' + line);
        });

        reports.push('');
        reports.push(err.message.grey);
        reports.push('');

      });

      // output the shizzle
      reports.forEach(function output (line) {
        this.logger.error(line);
      }.bind(this));
    }
function ( file , errors , options ) { var reports = [ ] , content = file . content . split ( '\n' ) ; errors . forEach ( function error ( err ) { // some linters don't return the location -_- if ( ! err . line ) return reports . push ( err . message . grey , '' ) ; var start = err . line > 3 ? err . line - 3 : 0 , stop = err . line + 2 , range = content . slice ( start , stop ) , numbers = _ . range ( start + 1 , stop + 1 ) , len = stop . toString ( ) . length ; reports . push ( 'Lint error: ' + err . line + ' col ' + err . column ) ; range . map ( function reformat ( line ) { var lineno = numbers . shift ( ) , offender = lineno === err . line , inline = / \'[^\']+?\' / , slice ; // this is the actual line with the error, so we should start finding // what the error is and how we could highlight it in the output if ( offender ) { if ( line . length < err . column ) { // we are missing something at the end of the line.. so add a red // square line += ' ' . inverse . red ; } else { // we have a direct match on a statement if ( inline . test ( err . message ) ) { slice = err . message . match ( inline ) [ 0 ] . replace ( / \' / g , '' ) ; } else { // it's happening in the center of things, so we can start // coloring inside the shizzle slice = line . slice ( err . column - 1 ) ; } line = line . replace ( slice , slice . inverse . red ) ; } } reports . push ( '  ' + pad ( lineno , len ) + ' | ' + line ) ; } ) ; reports . push ( '' ) ; reports . push ( err . message . grey ) ; reports . push ( '' ) ; } ) ; // output the shizzle reports . forEach ( function output ( line ) { this . logger . error ( line ) ; } . bind ( this ) ) ; }
Simple output of the errors in a human readable fashion.

@param {Object} file
@param {Array} errors
@api pprivate
Simple output of the errors in a human readable fashion .