1 | (() => {
|
2 | "use strict";
|
3 | var __webpack_modules__ = ({
|
4 |
|
5 | 429:
|
6 | ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | const chalk = __nccwpck_require__(744),
|
15 | stripAnsi = __nccwpck_require__(916),
|
16 | table = __nccwpck_require__(495);
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | function pluralize(word, count) {
|
29 | return (count === 1 ? word : `${word}s`);
|
30 | }
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | module.exports = function(results) {
|
37 |
|
38 | let output = "\n",
|
39 | errorCount = 0,
|
40 | warningCount = 0,
|
41 | fixableErrorCount = 0,
|
42 | fixableWarningCount = 0,
|
43 | summaryColor = "yellow";
|
44 |
|
45 | results.forEach(result => {
|
46 | const messages = result.messages;
|
47 |
|
48 | if (messages.length === 0) {
|
49 | return;
|
50 | }
|
51 |
|
52 | errorCount += result.errorCount;
|
53 | warningCount += result.warningCount;
|
54 | fixableErrorCount += result.fixableErrorCount;
|
55 | fixableWarningCount += result.fixableWarningCount;
|
56 |
|
57 | output += `${chalk.underline(result.filePath)}\n`;
|
58 |
|
59 | output += `${table(
|
60 | messages.map(message => {
|
61 | let messageType;
|
62 |
|
63 | if (message.fatal || message.severity === 2) {
|
64 | messageType = chalk.red("error");
|
65 | summaryColor = "red";
|
66 | } else {
|
67 | messageType = chalk.yellow("warning");
|
68 | }
|
69 |
|
70 | return [
|
71 | "",
|
72 | message.line || 0,
|
73 | message.column || 0,
|
74 | messageType,
|
75 | message.message.replace(/([^ ])\.$/u, "$1"),
|
76 | chalk.dim(message.ruleId || "")
|
77 | ];
|
78 | }),
|
79 | {
|
80 | align: ["", "r", "l"],
|
81 | stringLength(str) {
|
82 | return stripAnsi(str).length;
|
83 | }
|
84 | }
|
85 | ).split("\n").map(el => el.replace(/(\d+)\s+(\d+)/u, (m, p1, p2) => chalk.dim(`${p1}:${p2}`))).join("\n")}\n\n`;
|
86 | });
|
87 |
|
88 | const total = errorCount + warningCount;
|
89 |
|
90 | if (total > 0) {
|
91 | output += chalk[summaryColor].bold([
|
92 | "\u2716 ", total, pluralize(" problem", total),
|
93 | " (", errorCount, pluralize(" error", errorCount), ", ",
|
94 | warningCount, pluralize(" warning", warningCount), ")\n"
|
95 | ].join(""));
|
96 |
|
97 | if (fixableErrorCount > 0 || fixableWarningCount > 0) {
|
98 | output += chalk[summaryColor].bold([
|
99 | " ", fixableErrorCount, pluralize(" error", fixableErrorCount), " and ",
|
100 | fixableWarningCount, pluralize(" warning", fixableWarningCount),
|
101 | " potentially fixable with the `--fix` option.\n"
|
102 | ].join(""));
|
103 | }
|
104 | }
|
105 |
|
106 |
|
107 | return total > 0 ? chalk.reset(output) : "";
|
108 | };
|
109 |
|
110 |
|
111 | }),
|
112 |
|
113 | 744:
|
114 | ((module) => {
|
115 |
|
116 | module.exports = require("chalk");
|
117 |
|
118 | }),
|
119 |
|
120 | 916:
|
121 | ((module) => {
|
122 |
|
123 | module.exports = require("strip-ansi");
|
124 |
|
125 | }),
|
126 |
|
127 | 495:
|
128 | ((module) => {
|
129 |
|
130 | module.exports = require("text-table");
|
131 |
|
132 | })
|
133 |
|
134 | });
|
135 |
|
136 |
|
137 | var __webpack_module_cache__ = {};
|
138 |
|
139 |
|
140 | function __nccwpck_require__(moduleId) {
|
141 |
|
142 | var cachedModule = __webpack_module_cache__[moduleId];
|
143 | if (cachedModule !== undefined) {
|
144 | return cachedModule.exports;
|
145 | }
|
146 |
|
147 | var module = __webpack_module_cache__[moduleId] = {
|
148 |
|
149 |
|
150 | exports: {}
|
151 | };
|
152 |
|
153 |
|
154 | var threw = true;
|
155 | try {
|
156 | __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
157 | threw = false;
|
158 | } finally {
|
159 | if(threw) delete __webpack_module_cache__[moduleId];
|
160 | }
|
161 |
|
162 |
|
163 | return module.exports;
|
164 | }
|
165 |
|
166 |
|
167 |
|
168 |
|
169 | if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | var __webpack_exports__ = __nccwpck_require__(429);
|
177 | module.exports = __webpack_exports__;
|
178 |
|
179 | })()
|
180 | ; |
\ | No newline at end of file |