UNPKG

420 BJavaScriptView Raw
1'use strict'
2
3// istanbul ignore next
4// Work-around for duplicated error logs, see #142
5const errMsg = err => (err.privateMsg != null ? err.privateMsg : err.message)
6
7module.exports = function printErrors(errorInstance) {
8 if (Array.isArray(errorInstance.errors)) {
9 errorInstance.errors.forEach(lintError => {
10 console.error(errMsg(lintError))
11 })
12 } else {
13 console.error(errMsg(errorInstance))
14 }
15}