reporter.js
function (lintFile, callback) {
  fs.readFile(lintFile, function (err, data) {
    if (err) {
      callback(err);
    } else {
      var parser = new xml2js.Parser({
        mergeAttrs: true
      });
      parser.parseString(data, function (err, result) {
        if (err) {
          callback(err);
        } else if (result && result.jslint) {
          callback(null, result.jslint.file);
        } else {
          callback('Invalid jslint xml file');
        }
      });
    }
  });
}
function (lintFile, callback) {
  fs.readFile(lintFile, function (err, data) {
    if (err) {
      callback(err);
    } else {
      var parser = new xml2js.Parser({
        mergeAttrs: true
      });
      parser.parseString(data, function (err, result) {
        if (err) {
          callback(err);
        } else if (result && result.jslint) {
          callback(null, result.jslint.file);
        } else {
          callback('Invalid jslint xml file');
        }
      });
    }
  });
}
function ( lintFile , callback ) { fs . readFile ( lintFile , function ( err , data ) { if ( err ) { callback ( err ) ; } else { var parser = new xml2js . Parser ( { mergeAttrs : true } ) ; parser . parseString ( data , function ( err , result ) { if ( err ) { callback ( err ) ; } else if ( result && result . jslint ) { callback ( null , result . jslint . file ) ; } else { callback ( 'Invalid jslint xml file' ) ; } } ) ; } } ) ; }
Parse a jslint xml report.
@param {String} lintFile The path of the jslint xml file.
@param {Function} callback The function to invoke when the file is read. The callback will
be called with the following params: callback(err, lintErrors).
Parse a jslint xml report .