feat: docker compose maybe
This commit is contained in:
		
							
								
								
									
										60
									
								
								node_modules/eslint/lib/cli-engine/formatters/checkstyle.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								node_modules/eslint/lib/cli-engine/formatters/checkstyle.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,60 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview CheckStyle XML reporter
 | 
			
		||||
 * @author Ian Christian Myers
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
const xmlEscape = require("../xml-escape");
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Helper Functions
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns the severity of warning or error
 | 
			
		||||
 * @param {Object} message message object to examine
 | 
			
		||||
 * @returns {string} severity level
 | 
			
		||||
 * @private
 | 
			
		||||
 */
 | 
			
		||||
function getMessageType(message) {
 | 
			
		||||
    if (message.fatal || message.severity === 2) {
 | 
			
		||||
        return "error";
 | 
			
		||||
    }
 | 
			
		||||
    return "warning";
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results) {
 | 
			
		||||
 | 
			
		||||
    let output = "";
 | 
			
		||||
 | 
			
		||||
    output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
 | 
			
		||||
    output += "<checkstyle version=\"4.3\">";
 | 
			
		||||
 | 
			
		||||
    results.forEach(result => {
 | 
			
		||||
        const messages = result.messages;
 | 
			
		||||
 | 
			
		||||
        output += `<file name="${xmlEscape(result.filePath)}">`;
 | 
			
		||||
 | 
			
		||||
        messages.forEach(message => {
 | 
			
		||||
            output += [
 | 
			
		||||
                `<error line="${xmlEscape(message.line || 0)}"`,
 | 
			
		||||
                `column="${xmlEscape(message.column || 0)}"`,
 | 
			
		||||
                `severity="${xmlEscape(getMessageType(message))}"`,
 | 
			
		||||
                `message="${xmlEscape(message.message)}${message.ruleId ? ` (${message.ruleId})` : ""}"`,
 | 
			
		||||
                `source="${message.ruleId ? xmlEscape(`eslint.rules.${message.ruleId}`) : ""}" />`
 | 
			
		||||
            ].join(" ");
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        output += "</file>";
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    output += "</checkstyle>";
 | 
			
		||||
 | 
			
		||||
    return output;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										60
									
								
								node_modules/eslint/lib/cli-engine/formatters/compact.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								node_modules/eslint/lib/cli-engine/formatters/compact.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,60 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview Compact reporter
 | 
			
		||||
 * @author Nicholas C. Zakas
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Helper Functions
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns the severity of warning or error
 | 
			
		||||
 * @param {Object} message message object to examine
 | 
			
		||||
 * @returns {string} severity level
 | 
			
		||||
 * @private
 | 
			
		||||
 */
 | 
			
		||||
function getMessageType(message) {
 | 
			
		||||
    if (message.fatal || message.severity === 2) {
 | 
			
		||||
        return "Error";
 | 
			
		||||
    }
 | 
			
		||||
    return "Warning";
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results) {
 | 
			
		||||
 | 
			
		||||
    let output = "",
 | 
			
		||||
        total = 0;
 | 
			
		||||
 | 
			
		||||
    results.forEach(result => {
 | 
			
		||||
 | 
			
		||||
        const messages = result.messages;
 | 
			
		||||
 | 
			
		||||
        total += messages.length;
 | 
			
		||||
 | 
			
		||||
        messages.forEach(message => {
 | 
			
		||||
 | 
			
		||||
            output += `${result.filePath}: `;
 | 
			
		||||
            output += `line ${message.line || 0}`;
 | 
			
		||||
            output += `, col ${message.column || 0}`;
 | 
			
		||||
            output += `, ${getMessageType(message)}`;
 | 
			
		||||
            output += ` - ${message.message}`;
 | 
			
		||||
            output += message.ruleId ? ` (${message.ruleId})` : "";
 | 
			
		||||
            output += "\n";
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    if (total > 0) {
 | 
			
		||||
        output += `\n${total} problem${total !== 1 ? "s" : ""}`;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return output;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										46
									
								
								node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "name": "checkstyle",
 | 
			
		||||
        "description": "Outputs results to the [Checkstyle](https://checkstyle.sourceforge.io/) format."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "compact",
 | 
			
		||||
        "description": "Human-readable output format. Mimics the default output of JSHint."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "html",
 | 
			
		||||
        "description": "Outputs results to HTML. The `html` formatter is useful for visual presentation in the browser."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "jslint-xml",
 | 
			
		||||
        "description": "Outputs results to format compatible with the [JSLint Jenkins plugin](https://plugins.jenkins.io/jslint/)."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "json-with-metadata",
 | 
			
		||||
        "description": "Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "json",
 | 
			
		||||
        "description": "Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "junit",
 | 
			
		||||
        "description": "Outputs results to format compatible with the [JUnit Jenkins plugin](https://plugins.jenkins.io/junit/)."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "stylish",
 | 
			
		||||
        "description": "Human-readable output format. This is the default formatter."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "tap",
 | 
			
		||||
        "description": "Outputs results to the [Test Anything Protocol (TAP)](https://testanything.org/) specification format."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "unix",
 | 
			
		||||
        "description": "Outputs results to a format similar to many commands in UNIX-like systems. Parsable with tools such as [grep](https://www.gnu.org/software/grep/manual/grep.html), [sed](https://www.gnu.org/software/sed/manual/sed.html), and [awk](https://www.gnu.org/software/gawk/manual/gawk.html)."
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "name": "visualstudio",
 | 
			
		||||
        "description": "Outputs results to format compatible with the integrated terminal of the [Visual Studio](https://visualstudio.microsoft.com/) IDE. When using Visual Studio, you can click on the linting results in the integrated terminal to go to the issue in the source code."
 | 
			
		||||
    }
 | 
			
		||||
]
 | 
			
		||||
							
								
								
									
										351
									
								
								node_modules/eslint/lib/cli-engine/formatters/html.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										351
									
								
								node_modules/eslint/lib/cli-engine/formatters/html.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,351 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview HTML reporter
 | 
			
		||||
 * @author Julian Laval
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Helpers
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
const encodeHTML = (function() {
 | 
			
		||||
    const encodeHTMLRules = {
 | 
			
		||||
        "&": "&",
 | 
			
		||||
        "<": "<",
 | 
			
		||||
        ">": ">",
 | 
			
		||||
        '"': """,
 | 
			
		||||
        "'": "'"
 | 
			
		||||
    };
 | 
			
		||||
    const matchHTML = /[&<>"']/ug;
 | 
			
		||||
 | 
			
		||||
    return function(code) {
 | 
			
		||||
        return code
 | 
			
		||||
            ? code.toString().replace(matchHTML, m => encodeHTMLRules[m] || m)
 | 
			
		||||
            : "";
 | 
			
		||||
    };
 | 
			
		||||
}());
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get the final HTML document.
 | 
			
		||||
 * @param {Object} it data for the document.
 | 
			
		||||
 * @returns {string} HTML document.
 | 
			
		||||
 */
 | 
			
		||||
function pageTemplate(it) {
 | 
			
		||||
    const { reportColor, reportSummary, date, results } = it;
 | 
			
		||||
 | 
			
		||||
    return `
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html>
 | 
			
		||||
    <head>
 | 
			
		||||
        <meta charset="UTF-8">
 | 
			
		||||
        <title>ESLint Report</title>
 | 
			
		||||
        <link rel="icon" type="image/png" sizes="any" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAHaAAAB2gGFomX7AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABD1JREFUWMPFl11sk2UUx3/nbYtjxS1MF7MLMTECMgSTtSSyrQkLhAj7UBPnDSEGoxegGzMwojhXVpmTAA5iYpSoMQa8GBhFOrMFk03buei6yRAlcmOM0SEmU9d90b19jxcM1o5+sGnsc/e+z/l6ztf/HFFVMnns6QieeOCHBePGsHM+wrOtvLG2C4WRVDSSygNV7sCjlspxwDnPB44aols/DXk+mbMBmx/6OseITF1CuOtfevkPh2Uu+/jbdX8lujSScRlT5r7/QDlAfsRmfzmpnkQ/H3H13gf6bBrBn1uqK8WylgEnU8eZmk1repbfchJG1TyKyIKEwuBHFd3lD3naY3O1siiwXsVoBV2VgM1ht/QQUJk2ByqKghsQziYQ8ifKgexIXmuyzC4r67Y7R+xPAfuB/Nn3Cpva+0s7khpQVtZtd4bt51BWxtBYAiciprG7c7D4SixzU9PYalDL6110Ifb/w8W9eY7JqFeFHbO8fPGyLHwwFHJNJTSgwtVTB9oaw9BlQ+tO93vOxypoaQnfEYlI43SeCHDC4TDq9+51/h5fxr33q0ZfV9g04wat9Q943rjJgCp3952W2i8Bi6eDvdsfKj0cK/DYMRyXL4/sUJUmIHd2zYMezsvLaamp4WpcWN3BXSiHpuMwbGbZlnZ8tXY4rgosy+G7oRwQ0cAsd28YGgqfU5UjCZQDLALxDg+Hv/P5Rqvj4hwrS8izXzWb4spwc1GgENFnkpWRzxeuB+ssUHgLdb9UVdt8vpGdKQpze7n7y1U3DBChNRUuqOo9c+0+qpKKxyZqtAIYla7gY4JszAAQri93BSsMRZoyBcUC+w3Q3AyOA4sNhAOZ0q7Iq0b2vUNvK5zPgP+/H8+Zetdoa6uOikhdGurxebwvJY8Iz3V1rTMNAH+opEuQj5KTT/qA1yC+wyUjBm12OidaUtCcPNNX2h0Hx2JG69VulANZAJZJwfU7rzd/FHixuXniTdM0m4GtSQT7bTartqEh9yfImUEzkwKZmTwmo5a5JwkYBfcDL01/RkR5y8iWhtPBknB8ZxwtU9UjwOrrKCeizzc25nTGg1F/turEHoU9wMLpDvWKf8DTmNCAKnd/tqUTF4ElMXJ+A5rWDJS+41WsGWzALhJ+ErBWrLj9g+pqojHxlXJX8HGUg0BsR/x1yhxf3jm4cSzpQFLp6tmi6PEE7g1ZhtZ91ufpSZUAFa6gC+UoQslNaSmypT1U8mHKiUgEKS8KfgF4EpYunFI16tsHin+OG0LcgQK7yj7g6cSzpva2D3hKVNG0Y3mVO1BkqfSlmJrHBQ4uvM12gJHc6ETW8HZVfMRmXvyxxNC1Z/o839zyXlDuCr4nsC11J+MXueaVJWn6yPv+/pJtc9oLTNN4AeTvNGByd3rlhE2x9s5pLwDoHCy+grDzWmOZ95lUtLYj5Bma126Y8eX0/zj/ADxGyViSg4BXAAAAAElFTkSuQmCC">
 | 
			
		||||
        <link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMjk0LjgyNSAyNTguOTgyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPg0KPHBhdGggZmlsbD0nIzgwODBGMicgZD0nTTk3LjAyMSw5OS4wMTZsNDguNDMyLTI3Ljk2MmMxLjIxMi0wLjcsMi43MDYtMC43LDMuOTE4LDBsNDguNDMzLDI3Ljk2MiBjMS4yMTEsMC43LDEuOTU5LDEuOTkzLDEuOTU5LDMuMzkzdjU1LjkyNGMwLDEuMzk5LTAuNzQ4LDIuNjkzLTEuOTU5LDMuMzk0bC00OC40MzMsMjcuOTYyYy0xLjIxMiwwLjctMi43MDYsMC43LTMuOTE4LDAgbC00OC40MzItMjcuOTYyYy0xLjIxMi0wLjctMS45NTktMS45OTQtMS45NTktMy4zOTR2LTU1LjkyNEM5NS4wNjMsMTAxLjAwOSw5NS44MSw5OS43MTYsOTcuMDIxLDk5LjAxNicvPg0KPHBhdGggZmlsbD0nIzRCMzJDMycgZD0nTTI3My4zMzYsMTI0LjQ4OEwyMTUuNDY5LDIzLjgxNmMtMi4xMDItMy42NC01Ljk4NS02LjMyNS0xMC4xODgtNi4zMjVIODkuNTQ1IGMtNC4yMDQsMC04LjA4OCwyLjY4NS0xMC4xOSw2LjMyNWwtNTcuODY3LDEwMC40NWMtMi4xMDIsMy42NDEtMi4xMDIsOC4yMzYsMCwxMS44NzdsNTcuODY3LDk5Ljg0NyBjMi4xMDIsMy42NCw1Ljk4Niw1LjUwMSwxMC4xOSw1LjUwMWgxMTUuNzM1YzQuMjAzLDAsOC4wODctMS44MDUsMTAuMTg4LTUuNDQ2bDU3Ljg2Ny0xMDAuMDEgQzI3NS40MzksMTMyLjM5NiwyNzUuNDM5LDEyOC4xMjgsMjczLjMzNiwxMjQuNDg4IE0yMjUuNDE5LDE3Mi44OThjMCwxLjQ4LTAuODkxLDIuODQ5LTIuMTc0LDMuNTlsLTczLjcxLDQyLjUyNyBjLTEuMjgyLDAuNzQtMi44ODgsMC43NC00LjE3LDBsLTczLjc2Ny00Mi41MjdjLTEuMjgyLTAuNzQxLTIuMTc5LTIuMTA5LTIuMTc5LTMuNTlWODcuODQzYzAtMS40ODEsMC44ODQtMi44NDksMi4xNjctMy41OSBsNzMuNzA3LTQyLjUyN2MxLjI4Mi0wLjc0MSwyLjg4Ni0wLjc0MSw0LjE2OCwwbDczLjc3Miw0Mi41MjdjMS4yODMsMC43NDEsMi4xODYsMi4xMDksMi4xODYsMy41OVYxNzIuODk4eicvPg0KPC9zdmc+">
 | 
			
		||||
        <style>
 | 
			
		||||
            body {
 | 
			
		||||
                font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
 | 
			
		||||
                font-size: 16px;
 | 
			
		||||
                font-weight: normal;
 | 
			
		||||
                margin: 0;
 | 
			
		||||
                padding: 0;
 | 
			
		||||
                color: #333;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            #overview {
 | 
			
		||||
                padding: 20px 30px;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            td,
 | 
			
		||||
            th {
 | 
			
		||||
                padding: 5px 10px;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            h1 {
 | 
			
		||||
                margin: 0;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            table {
 | 
			
		||||
                margin: 30px;
 | 
			
		||||
                width: calc(100% - 60px);
 | 
			
		||||
                max-width: 1000px;
 | 
			
		||||
                border-radius: 5px;
 | 
			
		||||
                border: 1px solid #ddd;
 | 
			
		||||
                border-spacing: 0;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            th {
 | 
			
		||||
                font-weight: 400;
 | 
			
		||||
                font-size: medium;
 | 
			
		||||
                text-align: left;
 | 
			
		||||
                cursor: pointer;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            td.clr-1,
 | 
			
		||||
            td.clr-2,
 | 
			
		||||
            th span {
 | 
			
		||||
                font-weight: 700;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            th span {
 | 
			
		||||
                float: right;
 | 
			
		||||
                margin-left: 20px;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            th span::after {
 | 
			
		||||
                content: "";
 | 
			
		||||
                clear: both;
 | 
			
		||||
                display: block;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            tr:last-child td {
 | 
			
		||||
                border-bottom: none;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            tr td:first-child,
 | 
			
		||||
            tr td:last-child {
 | 
			
		||||
                color: #9da0a4;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            #overview.bg-0,
 | 
			
		||||
            tr.bg-0 th {
 | 
			
		||||
                color: #468847;
 | 
			
		||||
                background: #dff0d8;
 | 
			
		||||
                border-bottom: 1px solid #d6e9c6;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            #overview.bg-1,
 | 
			
		||||
            tr.bg-1 th {
 | 
			
		||||
                color: #f0ad4e;
 | 
			
		||||
                background: #fcf8e3;
 | 
			
		||||
                border-bottom: 1px solid #fbeed5;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            #overview.bg-2,
 | 
			
		||||
            tr.bg-2 th {
 | 
			
		||||
                color: #b94a48;
 | 
			
		||||
                background: #f2dede;
 | 
			
		||||
                border-bottom: 1px solid #eed3d7;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            td {
 | 
			
		||||
                border-bottom: 1px solid #ddd;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            td.clr-1 {
 | 
			
		||||
                color: #f0ad4e;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            td.clr-2 {
 | 
			
		||||
                color: #b94a48;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            td a {
 | 
			
		||||
                color: #3a33d1;
 | 
			
		||||
                text-decoration: none;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            td a:hover {
 | 
			
		||||
                color: #272296;
 | 
			
		||||
                text-decoration: underline;
 | 
			
		||||
            }
 | 
			
		||||
        </style>
 | 
			
		||||
    </head>
 | 
			
		||||
    <body>
 | 
			
		||||
        <div id="overview" class="bg-${reportColor}">
 | 
			
		||||
            <h1>ESLint Report</h1>
 | 
			
		||||
            <div>
 | 
			
		||||
                <span>${reportSummary}</span> - Generated on ${date}
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <table>
 | 
			
		||||
            <tbody>
 | 
			
		||||
                ${results}
 | 
			
		||||
            </tbody>
 | 
			
		||||
        </table>
 | 
			
		||||
        <script type="text/javascript">
 | 
			
		||||
            var groups = document.querySelectorAll("tr[data-group]");
 | 
			
		||||
            for (i = 0; i < groups.length; i++) {
 | 
			
		||||
                groups[i].addEventListener("click", function() {
 | 
			
		||||
                    var inGroup = document.getElementsByClassName(this.getAttribute("data-group"));
 | 
			
		||||
                    this.innerHTML = (this.innerHTML.indexOf("+") > -1) ? this.innerHTML.replace("+", "-") : this.innerHTML.replace("-", "+");
 | 
			
		||||
                    for (var j = 0; j < inGroup.length; j++) {
 | 
			
		||||
                        inGroup[j].style.display = (inGroup[j].style.display !== "none") ? "none" : "table-row";
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
        </script>
 | 
			
		||||
    </body>
 | 
			
		||||
</html>
 | 
			
		||||
`.trimStart();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Given a word and a count, append an s if count is not one.
 | 
			
		||||
 * @param {string} word A word in its singular form.
 | 
			
		||||
 * @param {int} count A number controlling whether word should be pluralized.
 | 
			
		||||
 * @returns {string} The original word with an s on the end if count is not one.
 | 
			
		||||
 */
 | 
			
		||||
function pluralize(word, count) {
 | 
			
		||||
    return (count === 1 ? word : `${word}s`);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Renders text along the template of x problems (x errors, x warnings)
 | 
			
		||||
 * @param {string} totalErrors Total errors
 | 
			
		||||
 * @param {string} totalWarnings Total warnings
 | 
			
		||||
 * @returns {string} The formatted string, pluralized where necessary
 | 
			
		||||
 */
 | 
			
		||||
function renderSummary(totalErrors, totalWarnings) {
 | 
			
		||||
    const totalProblems = totalErrors + totalWarnings;
 | 
			
		||||
    let renderedText = `${totalProblems} ${pluralize("problem", totalProblems)}`;
 | 
			
		||||
 | 
			
		||||
    if (totalProblems !== 0) {
 | 
			
		||||
        renderedText += ` (${totalErrors} ${pluralize("error", totalErrors)}, ${totalWarnings} ${pluralize("warning", totalWarnings)})`;
 | 
			
		||||
    }
 | 
			
		||||
    return renderedText;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get the color based on whether there are errors/warnings...
 | 
			
		||||
 * @param {string} totalErrors Total errors
 | 
			
		||||
 * @param {string} totalWarnings Total warnings
 | 
			
		||||
 * @returns {int} The color code (0 = green, 1 = yellow, 2 = red)
 | 
			
		||||
 */
 | 
			
		||||
function renderColor(totalErrors, totalWarnings) {
 | 
			
		||||
    if (totalErrors !== 0) {
 | 
			
		||||
        return 2;
 | 
			
		||||
    }
 | 
			
		||||
    if (totalWarnings !== 0) {
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get HTML (table row) describing a single message.
 | 
			
		||||
 * @param {Object} it data for the message.
 | 
			
		||||
 * @returns {string} HTML (table row) describing the message.
 | 
			
		||||
 */
 | 
			
		||||
function messageTemplate(it) {
 | 
			
		||||
    const {
 | 
			
		||||
        parentIndex,
 | 
			
		||||
        lineNumber,
 | 
			
		||||
        columnNumber,
 | 
			
		||||
        severityNumber,
 | 
			
		||||
        severityName,
 | 
			
		||||
        message,
 | 
			
		||||
        ruleUrl,
 | 
			
		||||
        ruleId
 | 
			
		||||
    } = it;
 | 
			
		||||
 | 
			
		||||
    return `
 | 
			
		||||
<tr style="display: none;" class="f-${parentIndex}">
 | 
			
		||||
    <td>${lineNumber}:${columnNumber}</td>
 | 
			
		||||
    <td class="clr-${severityNumber}">${severityName}</td>
 | 
			
		||||
    <td>${encodeHTML(message)}</td>
 | 
			
		||||
    <td>
 | 
			
		||||
        <a href="${ruleUrl ? ruleUrl : ""}" target="_blank" rel="noopener noreferrer">${ruleId ? ruleId : ""}</a>
 | 
			
		||||
    </td>
 | 
			
		||||
</tr>
 | 
			
		||||
`.trimStart();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get HTML (table rows) describing the messages.
 | 
			
		||||
 * @param {Array} messages Messages.
 | 
			
		||||
 * @param {int} parentIndex Index of the parent HTML row.
 | 
			
		||||
 * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis.
 | 
			
		||||
 * @returns {string} HTML (table rows) describing the messages.
 | 
			
		||||
 */
 | 
			
		||||
function renderMessages(messages, parentIndex, rulesMeta) {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Get HTML (table row) describing a message.
 | 
			
		||||
     * @param {Object} message Message.
 | 
			
		||||
     * @returns {string} HTML (table row) describing a message.
 | 
			
		||||
     */
 | 
			
		||||
    return messages.map(message => {
 | 
			
		||||
        const lineNumber = message.line || 0;
 | 
			
		||||
        const columnNumber = message.column || 0;
 | 
			
		||||
        let ruleUrl;
 | 
			
		||||
 | 
			
		||||
        if (rulesMeta) {
 | 
			
		||||
            const meta = rulesMeta[message.ruleId];
 | 
			
		||||
 | 
			
		||||
            if (meta && meta.docs && meta.docs.url) {
 | 
			
		||||
                ruleUrl = meta.docs.url;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return messageTemplate({
 | 
			
		||||
            parentIndex,
 | 
			
		||||
            lineNumber,
 | 
			
		||||
            columnNumber,
 | 
			
		||||
            severityNumber: message.severity,
 | 
			
		||||
            severityName: message.severity === 1 ? "Warning" : "Error",
 | 
			
		||||
            message: message.message,
 | 
			
		||||
            ruleId: message.ruleId,
 | 
			
		||||
            ruleUrl
 | 
			
		||||
        });
 | 
			
		||||
    }).join("\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get HTML (table row) describing the result for a single file.
 | 
			
		||||
 * @param {Object} it data for the file.
 | 
			
		||||
 * @returns {string} HTML (table row) describing the result for the file.
 | 
			
		||||
 */
 | 
			
		||||
function resultTemplate(it) {
 | 
			
		||||
    const { color, index, filePath, summary } = it;
 | 
			
		||||
 | 
			
		||||
    return `
 | 
			
		||||
<tr class="bg-${color}" data-group="f-${index}">
 | 
			
		||||
    <th colspan="4">
 | 
			
		||||
        [+] ${encodeHTML(filePath)}
 | 
			
		||||
        <span>${encodeHTML(summary)}</span>
 | 
			
		||||
    </th>
 | 
			
		||||
</tr>
 | 
			
		||||
`.trimStart();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Render the results.
 | 
			
		||||
 * @param {Array} results Test results.
 | 
			
		||||
 * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis.
 | 
			
		||||
 * @returns {string} HTML string describing the results.
 | 
			
		||||
 */
 | 
			
		||||
function renderResults(results, rulesMeta) {
 | 
			
		||||
    return results.map((result, index) => resultTemplate({
 | 
			
		||||
        index,
 | 
			
		||||
        color: renderColor(result.errorCount, result.warningCount),
 | 
			
		||||
        filePath: result.filePath,
 | 
			
		||||
        summary: renderSummary(result.errorCount, result.warningCount)
 | 
			
		||||
    }) + renderMessages(result.messages, index, rulesMeta)).join("\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results, data) {
 | 
			
		||||
    let totalErrors,
 | 
			
		||||
        totalWarnings;
 | 
			
		||||
 | 
			
		||||
    const metaData = data ? data.rulesMeta : {};
 | 
			
		||||
 | 
			
		||||
    totalErrors = 0;
 | 
			
		||||
    totalWarnings = 0;
 | 
			
		||||
 | 
			
		||||
    // Iterate over results to get totals
 | 
			
		||||
    results.forEach(result => {
 | 
			
		||||
        totalErrors += result.errorCount;
 | 
			
		||||
        totalWarnings += result.warningCount;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return pageTemplate({
 | 
			
		||||
        date: new Date(),
 | 
			
		||||
        reportColor: renderColor(totalErrors, totalWarnings),
 | 
			
		||||
        reportSummary: renderSummary(totalErrors, totalWarnings),
 | 
			
		||||
        results: renderResults(results, metaData)
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										41
									
								
								node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview JSLint XML reporter
 | 
			
		||||
 * @author Ian Christian Myers
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
const xmlEscape = require("../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;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										16
									
								
								node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview JSON reporter, including rules metadata
 | 
			
		||||
 * @author Chris Meyer
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results, data) {
 | 
			
		||||
    return JSON.stringify({
 | 
			
		||||
        results,
 | 
			
		||||
        metadata: data
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										13
									
								
								node_modules/eslint/lib/cli-engine/formatters/json.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								node_modules/eslint/lib/cli-engine/formatters/json.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview JSON reporter
 | 
			
		||||
 * @author Burak Yigit Kaya aka BYK
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results) {
 | 
			
		||||
    return JSON.stringify(results);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										82
									
								
								node_modules/eslint/lib/cli-engine/formatters/junit.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								node_modules/eslint/lib/cli-engine/formatters/junit.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,82 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview jUnit Reporter
 | 
			
		||||
 * @author Jamund Ferguson
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
const xmlEscape = require("../xml-escape");
 | 
			
		||||
const path = require("path");
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Helper Functions
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns the severity of warning or error
 | 
			
		||||
 * @param {Object} message message object to examine
 | 
			
		||||
 * @returns {string} severity level
 | 
			
		||||
 * @private
 | 
			
		||||
 */
 | 
			
		||||
function getMessageType(message) {
 | 
			
		||||
    if (message.fatal || message.severity === 2) {
 | 
			
		||||
        return "Error";
 | 
			
		||||
    }
 | 
			
		||||
    return "Warning";
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns a full file path without extension
 | 
			
		||||
 * @param {string} filePath input file path
 | 
			
		||||
 * @returns {string} file path without extension
 | 
			
		||||
 * @private
 | 
			
		||||
 */
 | 
			
		||||
function pathWithoutExt(filePath) {
 | 
			
		||||
    return path.join(path.dirname(filePath), path.basename(filePath, path.extname(filePath)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results) {
 | 
			
		||||
 | 
			
		||||
    let output = "";
 | 
			
		||||
 | 
			
		||||
    output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
 | 
			
		||||
    output += "<testsuites>\n";
 | 
			
		||||
 | 
			
		||||
    results.forEach(result => {
 | 
			
		||||
 | 
			
		||||
        const messages = result.messages;
 | 
			
		||||
        const classname = pathWithoutExt(result.filePath);
 | 
			
		||||
 | 
			
		||||
        if (messages.length > 0) {
 | 
			
		||||
            output += `<testsuite package="org.eslint" time="0" tests="${messages.length}" errors="${messages.length}" name="${result.filePath}">\n`;
 | 
			
		||||
            messages.forEach(message => {
 | 
			
		||||
                const type = message.fatal ? "error" : "failure";
 | 
			
		||||
 | 
			
		||||
                output += `<testcase time="0" name="org.eslint.${message.ruleId || "unknown"}" classname="${classname}">`;
 | 
			
		||||
                output += `<${type} message="${xmlEscape(message.message || "")}">`;
 | 
			
		||||
                output += "<![CDATA[";
 | 
			
		||||
                output += `line ${message.line || 0}, col `;
 | 
			
		||||
                output += `${message.column || 0}, ${getMessageType(message)}`;
 | 
			
		||||
                output += ` - ${xmlEscape(message.message || "")}`;
 | 
			
		||||
                output += (message.ruleId ? ` (${message.ruleId})` : "");
 | 
			
		||||
                output += "]]>";
 | 
			
		||||
                output += `</${type}>`;
 | 
			
		||||
                output += "</testcase>\n";
 | 
			
		||||
            });
 | 
			
		||||
            output += "</testsuite>\n";
 | 
			
		||||
        } else {
 | 
			
		||||
            output += `<testsuite package="org.eslint" time="0" tests="1" errors="0" name="${result.filePath}">\n`;
 | 
			
		||||
            output += `<testcase time="0" name="${result.filePath}" classname="${classname}" />\n`;
 | 
			
		||||
            output += "</testsuite>\n";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    output += "</testsuites>\n";
 | 
			
		||||
 | 
			
		||||
    return output;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										101
									
								
								node_modules/eslint/lib/cli-engine/formatters/stylish.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								node_modules/eslint/lib/cli-engine/formatters/stylish.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,101 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview Stylish reporter
 | 
			
		||||
 * @author Sindre Sorhus
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
const chalk = require("chalk"),
 | 
			
		||||
    stripAnsi = require("strip-ansi"),
 | 
			
		||||
    table = require("text-table");
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Helpers
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Given a word and a count, append an s if count is not one.
 | 
			
		||||
 * @param {string} word A word in its singular form.
 | 
			
		||||
 * @param {int} count A number controlling whether word should be pluralized.
 | 
			
		||||
 * @returns {string} The original word with an s on the end if count is not one.
 | 
			
		||||
 */
 | 
			
		||||
function pluralize(word, count) {
 | 
			
		||||
    return (count === 1 ? word : `${word}s`);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results) {
 | 
			
		||||
 | 
			
		||||
    let output = "\n",
 | 
			
		||||
        errorCount = 0,
 | 
			
		||||
        warningCount = 0,
 | 
			
		||||
        fixableErrorCount = 0,
 | 
			
		||||
        fixableWarningCount = 0,
 | 
			
		||||
        summaryColor = "yellow";
 | 
			
		||||
 | 
			
		||||
    results.forEach(result => {
 | 
			
		||||
        const messages = result.messages;
 | 
			
		||||
 | 
			
		||||
        if (messages.length === 0) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        errorCount += result.errorCount;
 | 
			
		||||
        warningCount += result.warningCount;
 | 
			
		||||
        fixableErrorCount += result.fixableErrorCount;
 | 
			
		||||
        fixableWarningCount += result.fixableWarningCount;
 | 
			
		||||
 | 
			
		||||
        output += `${chalk.underline(result.filePath)}\n`;
 | 
			
		||||
 | 
			
		||||
        output += `${table(
 | 
			
		||||
            messages.map(message => {
 | 
			
		||||
                let messageType;
 | 
			
		||||
 | 
			
		||||
                if (message.fatal || message.severity === 2) {
 | 
			
		||||
                    messageType = chalk.red("error");
 | 
			
		||||
                    summaryColor = "red";
 | 
			
		||||
                } else {
 | 
			
		||||
                    messageType = chalk.yellow("warning");
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return [
 | 
			
		||||
                    "",
 | 
			
		||||
                    message.line || 0,
 | 
			
		||||
                    message.column || 0,
 | 
			
		||||
                    messageType,
 | 
			
		||||
                    message.message.replace(/([^ ])\.$/u, "$1"),
 | 
			
		||||
                    chalk.dim(message.ruleId || "")
 | 
			
		||||
                ];
 | 
			
		||||
            }),
 | 
			
		||||
            {
 | 
			
		||||
                align: ["", "r", "l"],
 | 
			
		||||
                stringLength(str) {
 | 
			
		||||
                    return stripAnsi(str).length;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        ).split("\n").map(el => el.replace(/(\d+)\s+(\d+)/u, (m, p1, p2) => chalk.dim(`${p1}:${p2}`))).join("\n")}\n\n`;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const total = errorCount + warningCount;
 | 
			
		||||
 | 
			
		||||
    if (total > 0) {
 | 
			
		||||
        output += chalk[summaryColor].bold([
 | 
			
		||||
            "\u2716 ", total, pluralize(" problem", total),
 | 
			
		||||
            " (", errorCount, pluralize(" error", errorCount), ", ",
 | 
			
		||||
            warningCount, pluralize(" warning", warningCount), ")\n"
 | 
			
		||||
        ].join(""));
 | 
			
		||||
 | 
			
		||||
        if (fixableErrorCount > 0 || fixableWarningCount > 0) {
 | 
			
		||||
            output += chalk[summaryColor].bold([
 | 
			
		||||
                "  ", fixableErrorCount, pluralize(" error", fixableErrorCount), " and ",
 | 
			
		||||
                fixableWarningCount, pluralize(" warning", fixableWarningCount),
 | 
			
		||||
                " potentially fixable with the `--fix` option.\n"
 | 
			
		||||
            ].join(""));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Resets output color, for prevent change on top level
 | 
			
		||||
    return total > 0 ? chalk.reset(output) : "";
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										95
									
								
								node_modules/eslint/lib/cli-engine/formatters/tap.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								node_modules/eslint/lib/cli-engine/formatters/tap.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,95 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview TAP reporter
 | 
			
		||||
 * @author Jonathan Kingston
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
const yaml = require("js-yaml");
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Helper Functions
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns a canonical error level string based upon the error message passed in.
 | 
			
		||||
 * @param {Object} message Individual error message provided by eslint
 | 
			
		||||
 * @returns {string} Error level string
 | 
			
		||||
 */
 | 
			
		||||
function getMessageType(message) {
 | 
			
		||||
    if (message.fatal || message.severity === 2) {
 | 
			
		||||
        return "error";
 | 
			
		||||
    }
 | 
			
		||||
    return "warning";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Takes in a JavaScript object and outputs a TAP diagnostics string
 | 
			
		||||
 * @param {Object} diagnostic JavaScript object to be embedded as YAML into output.
 | 
			
		||||
 * @returns {string} diagnostics string with YAML embedded - TAP version 13 compliant
 | 
			
		||||
 */
 | 
			
		||||
function outputDiagnostics(diagnostic) {
 | 
			
		||||
    const prefix = "  ";
 | 
			
		||||
    let output = `${prefix}---\n`;
 | 
			
		||||
 | 
			
		||||
    output += prefix + yaml.dump(diagnostic).split("\n").join(`\n${prefix}`);
 | 
			
		||||
    output += "...\n";
 | 
			
		||||
    return output;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results) {
 | 
			
		||||
    let output = `TAP version 13\n1..${results.length}\n`;
 | 
			
		||||
 | 
			
		||||
    results.forEach((result, id) => {
 | 
			
		||||
        const messages = result.messages;
 | 
			
		||||
        let testResult = "ok";
 | 
			
		||||
        let diagnostics = {};
 | 
			
		||||
 | 
			
		||||
        if (messages.length > 0) {
 | 
			
		||||
            messages.forEach(message => {
 | 
			
		||||
                const severity = getMessageType(message);
 | 
			
		||||
                const diagnostic = {
 | 
			
		||||
                    message: message.message,
 | 
			
		||||
                    severity,
 | 
			
		||||
                    data: {
 | 
			
		||||
                        line: message.line || 0,
 | 
			
		||||
                        column: message.column || 0,
 | 
			
		||||
                        ruleId: message.ruleId || ""
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                // This ensures a warning message is not flagged as error
 | 
			
		||||
                if (severity === "error") {
 | 
			
		||||
                    testResult = "not ok";
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                /*
 | 
			
		||||
                 * If we have multiple messages place them under a messages key
 | 
			
		||||
                 * The first error will be logged as message key
 | 
			
		||||
                 * This is to adhere to TAP 13 loosely defined specification of having a message key
 | 
			
		||||
                 */
 | 
			
		||||
                if ("message" in diagnostics) {
 | 
			
		||||
                    if (typeof diagnostics.messages === "undefined") {
 | 
			
		||||
                        diagnostics.messages = [];
 | 
			
		||||
                    }
 | 
			
		||||
                    diagnostics.messages.push(diagnostic);
 | 
			
		||||
                } else {
 | 
			
		||||
                    diagnostics = diagnostic;
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        output += `${testResult} ${id + 1} - ${result.filePath}\n`;
 | 
			
		||||
 | 
			
		||||
        // If we have an error include diagnostics
 | 
			
		||||
        if (messages.length > 0) {
 | 
			
		||||
            output += outputDiagnostics(diagnostics);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return output;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										58
									
								
								node_modules/eslint/lib/cli-engine/formatters/unix.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								node_modules/eslint/lib/cli-engine/formatters/unix.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview unix-style formatter.
 | 
			
		||||
 * @author oshi-shinobu
 | 
			
		||||
 */
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Helper Functions
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns a canonical error level string based upon the error message passed in.
 | 
			
		||||
 * @param {Object} message Individual error message provided by eslint
 | 
			
		||||
 * @returns {string} Error level string
 | 
			
		||||
 */
 | 
			
		||||
function getMessageType(message) {
 | 
			
		||||
    if (message.fatal || message.severity === 2) {
 | 
			
		||||
        return "Error";
 | 
			
		||||
    }
 | 
			
		||||
    return "Warning";
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results) {
 | 
			
		||||
 | 
			
		||||
    let output = "",
 | 
			
		||||
        total = 0;
 | 
			
		||||
 | 
			
		||||
    results.forEach(result => {
 | 
			
		||||
 | 
			
		||||
        const messages = result.messages;
 | 
			
		||||
 | 
			
		||||
        total += messages.length;
 | 
			
		||||
 | 
			
		||||
        messages.forEach(message => {
 | 
			
		||||
 | 
			
		||||
            output += `${result.filePath}:`;
 | 
			
		||||
            output += `${message.line || 0}:`;
 | 
			
		||||
            output += `${message.column || 0}:`;
 | 
			
		||||
            output += ` ${message.message} `;
 | 
			
		||||
            output += `[${getMessageType(message)}${message.ruleId ? `/${message.ruleId}` : ""}]`;
 | 
			
		||||
            output += "\n";
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    if (total > 0) {
 | 
			
		||||
        output += `\n${total} problem${total !== 1 ? "s" : ""}`;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return output;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										63
									
								
								node_modules/eslint/lib/cli-engine/formatters/visualstudio.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								node_modules/eslint/lib/cli-engine/formatters/visualstudio.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,63 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @fileoverview Visual Studio compatible formatter
 | 
			
		||||
 * @author Ronald Pijnacker
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Helper Functions
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns the severity of warning or error
 | 
			
		||||
 * @param {Object} message message object to examine
 | 
			
		||||
 * @returns {string} severity level
 | 
			
		||||
 * @private
 | 
			
		||||
 */
 | 
			
		||||
function getMessageType(message) {
 | 
			
		||||
    if (message.fatal || message.severity === 2) {
 | 
			
		||||
        return "error";
 | 
			
		||||
    }
 | 
			
		||||
    return "warning";
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// Public Interface
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
module.exports = function(results) {
 | 
			
		||||
 | 
			
		||||
    let output = "",
 | 
			
		||||
        total = 0;
 | 
			
		||||
 | 
			
		||||
    results.forEach(result => {
 | 
			
		||||
 | 
			
		||||
        const messages = result.messages;
 | 
			
		||||
 | 
			
		||||
        total += messages.length;
 | 
			
		||||
 | 
			
		||||
        messages.forEach(message => {
 | 
			
		||||
 | 
			
		||||
            output += result.filePath;
 | 
			
		||||
            output += `(${message.line || 0}`;
 | 
			
		||||
            output += message.column ? `,${message.column}` : "";
 | 
			
		||||
            output += `): ${getMessageType(message)}`;
 | 
			
		||||
            output += message.ruleId ? ` ${message.ruleId}` : "";
 | 
			
		||||
            output += ` : ${message.message}`;
 | 
			
		||||
            output += "\n";
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    if (total === 0) {
 | 
			
		||||
        output += "no problems";
 | 
			
		||||
    } else {
 | 
			
		||||
        output += `\n${total} problem${total !== 1 ? "s" : ""}`;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return output;
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user