@uxfront/site-checks 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -19
- package/bin/site-checks.js +3 -3
- package/index.d.ts +260 -259
- package/lib/check.js +222 -196
- package/lib/cli.js +59 -56
- package/lib/html.js +166 -137
- package/lib/rules.js +1194 -1046
- package/lib/site.js +534 -501
- package/lib/validate.js +140 -117
- package/lighthouse.d.ts +26 -24
- package/lighthouse.js +52 -48
- package/package.json +2 -2
package/lib/check.js
CHANGED
|
@@ -7,27 +7,27 @@ import { PARSE, isPlainObject, list, pattern } from "./validate.js";
|
|
|
7
7
|
|
|
8
8
|
/** @type {Readonly<Required<ParseProfile>>} */
|
|
9
9
|
export const DEFAULT_PARSE = Object.freeze({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
scope: "document",
|
|
11
|
+
titleScope: "head",
|
|
12
|
+
titleTag: "any",
|
|
13
|
+
trimTitle: "after-decode",
|
|
14
|
+
quotes: "any",
|
|
15
|
+
caseSensitiveTags: false,
|
|
16
|
+
tagEnd: "word",
|
|
17
|
+
metaKey: "name-or-property",
|
|
18
|
+
trimValues: false,
|
|
19
|
+
decode: Object.freeze(/** @type {const} */ (["numeric", "quot", "apos", "lt", "gt", "amp"])),
|
|
20
|
+
decodeOrder: "one-pass",
|
|
21
|
+
decodeIgnoreCase: false,
|
|
22
|
+
count: "utf-16",
|
|
23
|
+
h1: "anywhere",
|
|
24
|
+
nodes: "graph-or-block",
|
|
25
|
+
typeArrays: true,
|
|
26
|
+
jsonLdType: "exact",
|
|
27
|
+
blankLines: "whitespace",
|
|
28
|
+
trimSitemap: true,
|
|
29
|
+
mergeDuplicateLocs: false,
|
|
30
|
+
headersParser: "lines",
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
/** @type {readonly RuleId[]} */
|
|
@@ -42,48 +42,50 @@ export const CORE_RULES = Object.freeze(RULES.filter((rule) => rule.core).map((r
|
|
|
42
42
|
* @param {CheckOptions["rules"]} rules
|
|
43
43
|
*/
|
|
44
44
|
function resolveRules(rules = {}) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
45
|
+
if (!isPlainObject(rules)) {
|
|
46
|
+
throw new TypeError("rules must be an object of rule IDs");
|
|
47
|
+
}
|
|
48
|
+
for (const id of Object.keys(rules)) {
|
|
49
|
+
if (!RULE_IDS.some((ruleId) => ruleId === id)) {
|
|
50
|
+
throw new Error(`Unknown rule "${id}". The rules are: ${RULE_IDS.join(", ")}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** @type {Map<RuleId, { enabled: boolean, options: Record<string, unknown> }>} */
|
|
54
|
+
const resolved = new Map();
|
|
55
|
+
for (const rule of RULES) {
|
|
56
|
+
const setting = /** @type {Record<string, unknown>} */ (rules)[rule.id];
|
|
57
|
+
if (setting !== undefined && typeof setting !== "boolean" && !isPlainObject(setting)) {
|
|
58
|
+
throw new TypeError(
|
|
59
|
+
`rules["${rule.id}"] must be true, false or an object of options, not ${JSON.stringify(setting)}`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
const given = isPlainObject(setting) ? setting : {};
|
|
63
|
+
const schema = SCHEMAS[rule.id] ?? {};
|
|
64
|
+
for (const [key, value] of Object.entries(given)) {
|
|
65
|
+
const check = schema[key];
|
|
66
|
+
if (!check) {
|
|
67
|
+
const known = Object.keys(schema);
|
|
68
|
+
throw new Error(
|
|
69
|
+
`Rule "${rule.id}" has no option "${key}"${known.length ? `. Its options are: ${known.join(", ")}` : ". It takes no options"}`,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
check(value, `rules["${rule.id}"].${key}`);
|
|
73
|
+
}
|
|
74
|
+
const enabled = setting === undefined ? rule.core : setting !== false;
|
|
75
|
+
if (rule.id === "json-ld-organization" && enabled && !given.name) {
|
|
76
|
+
throw new TypeError(
|
|
77
|
+
'rules["json-ld-organization"] needs a name, like { name: "Unframework" }',
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
resolved.set(rule.id, { enabled, options: { ...rule.defaults, ...given } });
|
|
81
|
+
}
|
|
82
|
+
// Pages left out of the sitemap on purpose are, by default, the ones out of the index.
|
|
83
|
+
const coverage = resolved.get("sitemap-coverage");
|
|
84
|
+
const given = /** @type {Record<string, unknown>} */ (rules)["sitemap-coverage"];
|
|
85
|
+
if (coverage && !(isPlainObject(given) && "exclude" in given)) {
|
|
86
|
+
coverage.options.exclude = resolved.get("sitemap-indexable")?.options.sources;
|
|
87
|
+
}
|
|
88
|
+
return resolved;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
/** @param {unknown} error */
|
|
@@ -91,144 +93,168 @@ const messageOf = (error) => (error instanceof Error ? error.message : String(er
|
|
|
91
93
|
|
|
92
94
|
/** @param {CheckOptions} options @returns {Report} */
|
|
93
95
|
export function checkSeo(options) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
96
|
+
if (!isPlainObject(options)) {
|
|
97
|
+
throw new TypeError("checkSeo takes an object of options");
|
|
98
|
+
}
|
|
99
|
+
const { site: origin, dist, pages: only, parse = {}, rules, extraRules = [], now } = options;
|
|
100
|
+
if (typeof origin !== "string" || !/^https?:\/\/[^/]+\/?$/.test(origin)) {
|
|
101
|
+
throw new TypeError(
|
|
102
|
+
`site must be an origin, like "https://uxfront.com", not ${JSON.stringify(origin)}`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
if (typeof dist !== "string" || !dist) {
|
|
106
|
+
throw new TypeError("dist must be the build folder");
|
|
107
|
+
}
|
|
108
|
+
if (!isPlainObject(parse)) {
|
|
109
|
+
throw new TypeError("parse must be an object of settings");
|
|
110
|
+
}
|
|
111
|
+
for (const [key, value] of Object.entries(parse)) {
|
|
112
|
+
const check = PARSE[key];
|
|
113
|
+
if (!check) {
|
|
114
|
+
throw new Error(
|
|
115
|
+
`parse has no option "${key}". Its options are: ${Object.keys(PARSE).join(", ")}`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
check(value, `parse.${key}`);
|
|
119
|
+
}
|
|
120
|
+
if (only !== undefined) {
|
|
121
|
+
list(pattern, { nonEmpty: true })(only, "pages");
|
|
122
|
+
}
|
|
123
|
+
// oxlint-disable-next-line @nkzw/no-instanceof -- now comes from a config, and only a Date has getTime
|
|
124
|
+
if (now !== undefined && !(now instanceof Date && !Number.isNaN(now.getTime()))) {
|
|
125
|
+
throw new TypeError("now must be a Date");
|
|
126
|
+
}
|
|
127
|
+
const profile = /** @type {Required<ParseProfile>} */ ({ ...DEFAULT_PARSE, ...parse });
|
|
128
|
+
const resolved = resolveRules(rules);
|
|
129
|
+
if (!Array.isArray(extraRules)) {
|
|
130
|
+
throw new TypeError("extraRules must be a list");
|
|
131
|
+
}
|
|
132
|
+
const extraIds = new Set();
|
|
133
|
+
for (const extra of extraRules) {
|
|
134
|
+
if (!extra || typeof extra.id !== "string" || !extra.id || typeof extra.check !== "function") {
|
|
135
|
+
throw new TypeError("Each extra rule needs an id and a check function");
|
|
136
|
+
}
|
|
137
|
+
if (RULE_IDS.some((id) => id === extra.id) || extraIds.has(extra.id)) {
|
|
138
|
+
throw new Error(`Two rules have the ID "${extra.id}"`);
|
|
139
|
+
}
|
|
140
|
+
extraIds.add(extra.id);
|
|
141
|
+
}
|
|
129
142
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
/** @template {RuleId} Id @param {Id} id */
|
|
144
|
+
const optionsOf = (id) =>
|
|
145
|
+
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- resolveRules checked them
|
|
146
|
+
/** @type {Required<RuleOptions[Id]>} */ (/** @type {unknown} */ (resolved.get(id)?.options));
|
|
147
|
+
const pageOptions = optionsOf("sitemap-pages");
|
|
148
|
+
const site = new Site({
|
|
149
|
+
site: origin,
|
|
150
|
+
dist,
|
|
151
|
+
profile,
|
|
152
|
+
paths: pageOptions.paths,
|
|
153
|
+
now: now ?? new Date(),
|
|
154
|
+
});
|
|
141
155
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
156
|
+
// The pages the page rules read: each `<loc>` served from an HTML file, or each path in `pages`.
|
|
157
|
+
const notFound = site.read("404.html");
|
|
158
|
+
/** @type {{ loc: string, path: string }[]} */
|
|
159
|
+
let targets = only
|
|
160
|
+
? only.map((path) => ({ loc: `${site.site}${path}`, path }))
|
|
161
|
+
: site.sitemap.entries.flatMap(({ loc, url }) => (url ? [{ loc, path: url.pathname }] : []));
|
|
162
|
+
if (profile.mergeDuplicateLocs) {
|
|
163
|
+
targets = [...new Map(targets.map((target) => [target.loc, target])).values()];
|
|
164
|
+
}
|
|
165
|
+
/** @type {Page[]} */
|
|
166
|
+
const pages = [];
|
|
167
|
+
/** @type {string[]} */
|
|
168
|
+
const missing = [];
|
|
169
|
+
for (const { loc, path } of targets) {
|
|
170
|
+
const file = site.resolve(path);
|
|
171
|
+
if (!file) {
|
|
172
|
+
if (only) {
|
|
173
|
+
missing.push(path);
|
|
174
|
+
}
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
if (pageOptions.notFoundCopy && notFound !== undefined && site.read(file) === notFound) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
pages.push(site.page(loc, path, file));
|
|
181
|
+
}
|
|
182
|
+
// A path in `pages` with no file is a problem of sitemap-pages, so it never passes quietly.
|
|
183
|
+
if (missing.length && !resolved.get("sitemap-pages")?.enabled) {
|
|
184
|
+
throw new Error(
|
|
185
|
+
`pages has paths with no HTML file in dist, ${missing.join(", ")}, and sitemap-pages, which reports them, is off`,
|
|
186
|
+
);
|
|
187
|
+
}
|
|
171
188
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
189
|
+
/** @type {Report["rules"]} */
|
|
190
|
+
const results = [];
|
|
191
|
+
/** @param {string} id @param {(report: (target: string, message: string) => void) => void} run */
|
|
192
|
+
const record = (id, run) => {
|
|
193
|
+
/** @type {Problem[]} */
|
|
194
|
+
const problems = [];
|
|
195
|
+
const report = (/** @type {string} */ target, /** @type {string} */ message) =>
|
|
196
|
+
problems.push({ target: String(target), message: String(message) });
|
|
197
|
+
try {
|
|
198
|
+
run(report);
|
|
199
|
+
} catch (error) {
|
|
200
|
+
// A file the rule can't read, like a value no decoder can read, is a problem with the
|
|
201
|
+
// build, so the rule reports it and the other rules still run.
|
|
202
|
+
report("(the rule)", `couldn't finish: ${messageOf(error)}`);
|
|
203
|
+
}
|
|
204
|
+
results.push({ id, problems });
|
|
205
|
+
};
|
|
206
|
+
for (const rule of RULES) {
|
|
207
|
+
const setting = resolved.get(rule.id);
|
|
208
|
+
if (!setting?.enabled) {
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
record(rule.id, (report) => {
|
|
212
|
+
// RULES holds one Rule type per ID, so TypeScript can't call their union's run. resolveRules
|
|
213
|
+
// checked these options against this rule's schema.
|
|
214
|
+
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- a union of run types takes no call
|
|
215
|
+
/** @type {(context: object, options: object) => void} */ (rule.run)(
|
|
216
|
+
{ site, pages, optionsOf, report },
|
|
217
|
+
setting.options,
|
|
218
|
+
);
|
|
219
|
+
if (rule.id === "sitemap-pages") {
|
|
220
|
+
for (const path of missing) {
|
|
221
|
+
report(path, "a path in pages has no HTML file in dist");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
for (const extra of extraRules) {
|
|
227
|
+
record(extra.id, (report) =>
|
|
228
|
+
extra.check({
|
|
229
|
+
site: site.site,
|
|
230
|
+
dist,
|
|
231
|
+
pages,
|
|
232
|
+
sitemap: site.sitemap.entries.map(({ loc, lastmod }) => ({ loc, lastmod })),
|
|
233
|
+
read: (/** @type {string} */ file) => site.read(file),
|
|
234
|
+
headersFor: (/** @type {string} */ url) => site.headersFor(url),
|
|
235
|
+
report,
|
|
236
|
+
}),
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
rules: results,
|
|
241
|
+
pages: pages.length,
|
|
242
|
+
problems: results.reduce((sum, result) => sum + result.problems.length, 0),
|
|
243
|
+
};
|
|
220
244
|
}
|
|
221
245
|
|
|
222
246
|
/** @param {Report} report */
|
|
223
247
|
export function formatReport({ rules, pages, problems }) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
248
|
+
const lines = [];
|
|
249
|
+
for (const { id, problems: own } of rules) {
|
|
250
|
+
lines.push(`${own.length ? "✗" : "✓"} ${id}`);
|
|
251
|
+
for (const { target, message } of own) {
|
|
252
|
+
lines.push(` ${target}: ${message}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
lines.push(
|
|
256
|
+
"",
|
|
257
|
+
`${pages} ${pages === 1 ? "page" : "pages"} checked, ${problems} ${problems === 1 ? "problem" : "problems"}`,
|
|
258
|
+
);
|
|
259
|
+
return lines.join("\n");
|
|
234
260
|
}
|
package/lib/cli.js
CHANGED
|
@@ -18,60 +18,63 @@ Exits 0 when every rule passes, 1 on a problem, and 2 when it can't run.`;
|
|
|
18
18
|
* @param {{ out: (text: string) => void, err: (text: string) => void, cwd: string }} io
|
|
19
19
|
*/
|
|
20
20
|
export async function main(args, { out, err, cwd }) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
21
|
+
const [command, ...rest] = args;
|
|
22
|
+
if (command === "--help" || command === "-h" || command === "help") {
|
|
23
|
+
out(`${USAGE}\n`);
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
if (command !== "seo") {
|
|
27
|
+
err(`${USAGE}\n`);
|
|
28
|
+
return 2;
|
|
29
|
+
}
|
|
30
|
+
let dist;
|
|
31
|
+
let config = "site-checks.config.mjs";
|
|
32
|
+
for (let index = 0; index < rest.length; index++) {
|
|
33
|
+
const arg = rest[index] ?? "";
|
|
34
|
+
if (arg === "--config" || arg === "-c") {
|
|
35
|
+
const next = rest[++index];
|
|
36
|
+
if (!next) {
|
|
37
|
+
err("--config needs a file\n");
|
|
38
|
+
return 2;
|
|
39
|
+
}
|
|
40
|
+
config = next;
|
|
41
|
+
} else if (arg.startsWith("--config=")) {
|
|
42
|
+
config = arg.slice("--config=".length);
|
|
43
|
+
} else if (arg.startsWith("-") || dist !== undefined) {
|
|
44
|
+
err(`Unexpected argument ${arg}\n\n${USAGE}\n`);
|
|
45
|
+
return 2;
|
|
46
|
+
} else {
|
|
47
|
+
dist = arg;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const folder = resolve(cwd, dist ?? "dist");
|
|
51
|
+
if (!existsSync(join(folder, "index.html"))) {
|
|
52
|
+
err(`No build in ${folder}: there's no index.html. Build the site first.\n`);
|
|
53
|
+
return 2;
|
|
54
|
+
}
|
|
55
|
+
const file = resolve(cwd, config);
|
|
56
|
+
if (!existsSync(file)) {
|
|
57
|
+
err(`No config at ${file}. Pass one with --config <file>.\n`);
|
|
58
|
+
return 2;
|
|
59
|
+
}
|
|
60
|
+
let options;
|
|
61
|
+
try {
|
|
62
|
+
options = (await import(pathToFileURL(file).href)).default;
|
|
63
|
+
} catch (error) {
|
|
64
|
+
err(`Couldn't load ${config}: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
65
|
+
return 2;
|
|
66
|
+
}
|
|
67
|
+
if (!options || typeof options !== "object") {
|
|
68
|
+
err(`${config} has no default export of options\n`);
|
|
69
|
+
return 2;
|
|
70
|
+
}
|
|
71
|
+
let report;
|
|
72
|
+
try {
|
|
73
|
+
report = checkSeo({ ...options, dist: folder });
|
|
74
|
+
} catch (error) {
|
|
75
|
+
err(`${config}: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
76
|
+
return 2;
|
|
77
|
+
}
|
|
78
|
+
out(`${formatReport(report)}\n`);
|
|
79
|
+
return report.problems ? 1 : 0;
|
|
77
80
|
}
|