gecko/tools/lint/eslint-formatter.js
Dave Townsend 941a8425c4 Bug 1229588: Add a taskcluster test for eslint. r=dustin
Adds a new lint docker image for linting tools and adds an eslint-gecko task
that uses it to run eslint over the tree.
2016-01-06 13:33:30 -08:00

24 lines
789 B
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const path = require("path")
module.exports = function(results) {
for (let file of results) {
let filePath = path.relative(".", file.filePath);
for (let message of file.messages) {
let status = message.message;
if ("ruleId" in message) {
status = `${status} (${message.ruleId})`;
}
let severity = message.severity == 1 ? "TEST-UNEXPECTED-WARNING"
: "TEST-UNEXPECTED-ERROR";
console.log(`${severity} | ${filePath}:${message.line}:${message.column} | ${status}`);
}
}
};