@jamesacarr/eslint-formatter-github-actions
Version:
Reporter for Jest that outputs GitHub Actions annotations
37 lines (33 loc) • 1.13 kB
JavaScript
var core = require('@actions/core');
var command = require('@actions/core/lib/command');
const severityLabels = {
0: 'debug',
1: 'warning',
2: 'error',
};
const GitHubActionsReporter = {
format(results) {
core.startGroup('Lint Annotations');
const errors = results.flatMap(result => result.messages.map(message => {
var _a, _b;
return ({
message: message.message,
severity: severityLabels[message.severity],
properties: {
file: result.filePath,
line: (_a = message.line) === null || _a === void 0 ? void 0 : _a.toString(),
col: (_b = message.column) === null || _b === void 0 ? void 0 : _b.toString(),
},
});
}));
for (const { severity, properties, message } of errors) {
command.issueCommand(severity, properties, message);
}
core.endGroup();
return '';
},
};
var index = GitHubActionsReporter.format;
module.exports = index;
//# sourceMappingURL=index.cjs.map
;