chore: Enable linting in scripts.

This commit is contained in:
cpojer
2026-01-31 21:29:14 +09:00
parent 0ffc251704
commit 1838ab019b
21 changed files with 314 additions and 124 deletions

View File

@@ -32,8 +32,14 @@ function compactStrings(values) {
if (value === null || value === undefined) {
continue;
}
const normalized = String(value).trim();
if (normalized.length > 0) {
const normalized =
typeof value === "string"
? value.trim()
: typeof value === "number" || typeof value === "boolean"
? String(value).trim()
: null;
if (normalized?.length > 0) {
result.push(normalized);
}
}
@@ -62,7 +68,7 @@ function walkMarkdownFiles(dir, base = dir) {
files.push(relative(base, fullPath));
}
}
return files.sort((a, b) => a.localeCompare(b));
return files.toSorted((a, b) => a.localeCompare(b));
}
/**