Sha256: 399b7ee8928a6e8b2b758235ffb5df172f3e0c7fd9206f9492f266fa03754762

Contents?: true

Size: 1.04 KB

Versions: 44

Compression:

Stored size: 1.04 KB

Contents

/**
 * @fileoverview JSLint XML reporter
 * @author Ian Christian Myers
 */
"use strict";

const xmlEscape = require("../util/xml-escape");

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = function(results) {

    let output = "";

    output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
    output += "<jslint>";

    results.forEach(result => {
        const messages = result.messages;

        output += `<file name="${result.filePath}">`;

        messages.forEach(message => {
            output += [
                `<issue line="${message.line}"`,
                `char="${message.column}"`,
                `evidence="${xmlEscape(message.source || "")}"`,
                `reason="${xmlEscape(message.message || "")}${message.ruleId ? ` (${message.ruleId})` : ""}" />`
            ].join(" ");
        });

        output += "</file>";

    });

    output += "</jslint>";

    return output;
};

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
govuk_publishing_components-18.0.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.21.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.20.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.19.1 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.19.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.18.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.17.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.16.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.15.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.14.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.13.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.12.2 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.12.1 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.12.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.11.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.10.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.9.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.8.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.7.0 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js
govuk_publishing_components-17.6.1 node_modules/standard/node_modules/eslint/lib/formatters/jslint-xml.js