Sha256: e23c7ca2c5817d2f92ed03f0782b6dd6931929f26f00697530f98f247cb5ce75

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

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

var xmlescape = require("xml-escape");

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

module.exports = function(results) {

    var output = "";

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

    results.forEach(function(result) {
        var messages = result.messages;

        output += "<file name=\"" + result.filePath + "\">";

        messages.forEach(function(message) {
            output += "<issue line=\"" + message.line + "\" " +
                "char=\"" + message.column + "\" " +
                "evidence=\"" + xmlescape(message.source || "") + "\" " +
                "reason=\"" + xmlescape(message.message || "") +
                (message.ruleId ? " (" + message.ruleId + ")" : "") + "\" />";
        });

        output += "</file>";

    });

    output += "</jslint>";

    return output;
};

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/lib/formatters/jslint-xml.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/lib/formatters/jslint-xml.js