Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | // Adapted from https://eslint.org/docs/latest/extend/custom-formatters /** * @param {import('eslint').ESLint.LintResult[]} results * @returns {string} */ module.exports = (results) => { // accumulate the errors and warnings const summary = results.reduce( (seq, current) => { seq.errors += current.errorCount; seq.warnings += current.warningCount; return seq; }, { errors: 0, warnings: 0, }, ); return summary.errors > 0 || summary.warnings > 0 ? `Errors: ${summary.errors}, Warnings: ${summary.warnings}\n` : ''; }; |