src/formatter.js
function getTeamCityOutput(results, propNames) {
  const config = getUserConfig(propNames || {});

  if (process.env.ESLINT_TEAMCITY_DISPLAY_CONFIG) {
    console.info(`Running ESLint Teamcity with config: ${JSON.stringify(config, null, 4)}`);
  }

  let outputMessages = [];
  switch (config.reporter.toLowerCase()) {
    case 'inspections': {
      outputMessages = formatInspections(results, config);
      break;
    }
    case 'errors':
    default: {
      outputMessages = formatErrors(results, config);
      break;
    }
  }

  return outputMessages.join('\n');
}
function getTeamCityOutput(results, propNames) {
  const config = getUserConfig(propNames || {});

  if (process.env.ESLINT_TEAMCITY_DISPLAY_CONFIG) {
    console.info(`Running ESLint Teamcity with config: ${JSON.stringify(config, null, 4)}`);
  }

  let outputMessages = [];
  switch (config.reporter.toLowerCase()) {
    case 'inspections': {
      outputMessages = formatInspections(results, config);
      break;
    }
    case 'errors':
    default: {
      outputMessages = formatErrors(results, config);
      break;
    }
  }

  return outputMessages.join('\n');
}
function getTeamCityOutput ( results , propNames ) { const config = getUserConfig ( propNames || { } ) ; if ( process . env . ESLINT_TEAMCITY_DISPLAY_CONFIG ) { console . info ( ` ${ JSON . stringify ( config , null , 4 ) } ` ) ; } let outputMessages = [ ] ; switch ( config . reporter . toLowerCase ( ) ) { case 'inspections' : { outputMessages = formatInspections ( results , config ) ; break ; } case 'errors' : default : { outputMessages = formatErrors ( results , config ) ; break ; } } return outputMessages . join ( '\n' ) ; }
Determines the formatter to use and any config variables to use
@param {array} results The output generated by running ESLint.
@param {object} [propNames] Optional config variables that will override all other
config settings
@returns {string} The concatenated output of all messages to display in TeamCity
Determines the formatter to use and any config variables to use