-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (24 loc) · 805 Bytes
/
index.js
File metadata and controls
32 lines (24 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
const chalk = require('chalk');
module.exports = {
report: function report (results) {
results.forEach((result) => {
let output = '';
if (result.severity === 'error') {
output += chalk.red('Error: ');
} else {
output += chalk.yellow('Warning: ');
}
output += chalk.cyan(result.file) + ': ';
if (result.line) {
output += chalk.magenta(`line ${ result.line }`) + ', ';
}
if (result.column) {
output += chalk.magenta(`col ${ result.column }`) + ', ';
}
output += chalk.green(result.linter) + ': ';
output += result.message;
console.log(output);
});
}
};