'use strict';constconcat=require('../utils').concat;constchalk=require('chalk');constinfos=['You may use special comments to disable some warnings.','Use '+chalk.yellow('// eslint-disable-next-line')+' to ignore the next line.','Use '+chalk.yellow('/* eslint-disable */')+' to ignore all warnings in a file.'];functiondisplayError(error){return[error.message,'']}functionformat(errors,type){constlintErrors=errors.filter(e=>e.type==='lint-error');if(lintErrors.length>0){constflatten=(accum,curr)=>accum.concat(curr);returnconcat(lintErrors.map(error=>displayError(error)).reduce(flatten,[]),infos)}return[];}module.exports=format;