1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00
react-templates/src/shell.js
2017-06-29 10:35:15 +03:00

17 lines
410 B
JavaScript

'use strict'
const _ = require('lodash')
/**
* @param {CONTEXT} context
* @return {number}
*/
function printResults(context) {
const warnings = context.getMessages()
const out = require(`./formatters/${context.options.format}`)(warnings)
context.report(out)
const grouped = _.groupBy(warnings, 'level')
return grouped.ERROR ? grouped.ERROR.length : 0
}
module.exports = {printResults}