UNPKG

3.35 kBJavaScriptView Raw
1/******/ (() => { // webpackBootstrap
2/******/ "use strict";
3/******/ var __webpack_modules__ = ({
4
5/***/ 766:
6/***/ ((module) => {
7
8/**
9 * @fileoverview Compact reporter
10 * @author Nicholas C. Zakas
11 */
12
13
14//------------------------------------------------------------------------------
15// Helper Functions
16//------------------------------------------------------------------------------
17
18/**
19 * Returns the severity of warning or error
20 * @param {Object} message message object to examine
21 * @returns {string} severity level
22 * @private
23 */
24function getMessageType(message) {
25 if (message.fatal || message.severity === 2) {
26 return "Error";
27 }
28 return "Warning";
29
30}
31
32
33//------------------------------------------------------------------------------
34// Public Interface
35//------------------------------------------------------------------------------
36
37module.exports = function(results) {
38
39 let output = "",
40 total = 0;
41
42 results.forEach(result => {
43
44 const messages = result.messages;
45
46 total += messages.length;
47
48 messages.forEach(message => {
49
50 output += `${result.filePath}: `;
51 output += `line ${message.line || 0}`;
52 output += `, col ${message.column || 0}`;
53 output += `, ${getMessageType(message)}`;
54 output += ` - ${message.message}`;
55 output += message.ruleId ? ` (${message.ruleId})` : "";
56 output += "\n";
57
58 });
59
60 });
61
62 if (total > 0) {
63 output += `\n${total} problem${total !== 1 ? "s" : ""}`;
64 }
65
66 return output;
67};
68
69
70/***/ })
71
72/******/ });
73/************************************************************************/
74/******/ // The module cache
75/******/ var __webpack_module_cache__ = {};
76/******/
77/******/ // The require function
78/******/ function __nccwpck_require__(moduleId) {
79/******/ // Check if module is in cache
80/******/ var cachedModule = __webpack_module_cache__[moduleId];
81/******/ if (cachedModule !== undefined) {
82/******/ return cachedModule.exports;
83/******/ }
84/******/ // Create a new module (and put it into the cache)
85/******/ var module = __webpack_module_cache__[moduleId] = {
86/******/ // no module.id needed
87/******/ // no module.loaded needed
88/******/ exports: {}
89/******/ };
90/******/
91/******/ // Execute the module function
92/******/ var threw = true;
93/******/ try {
94/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
95/******/ threw = false;
96/******/ } finally {
97/******/ if(threw) delete __webpack_module_cache__[moduleId];
98/******/ }
99/******/
100/******/ // Return the exports of the module
101/******/ return module.exports;
102/******/ }
103/******/
104/************************************************************************/
105/******/ /* webpack/runtime/compat */
106/******/
107/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
108/******/
109/************************************************************************/
110/******/
111/******/ // startup
112/******/ // Load entry module and return exports
113/******/ // This entry module is referenced by other modules so it can't be inlined
114/******/ var __webpack_exports__ = __nccwpck_require__(766);
115/******/ module.exports = __webpack_exports__;
116/******/
117/******/ })()
118;
\No newline at end of file