chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -12,17 +12,27 @@ type AcceptedEnvOption = {
};
function formatEnvValue(value: string, redact?: boolean): string {
if (redact) return "<redacted>";
if (redact) {
return "<redacted>";
}
const singleLine = value.replace(/\s+/g, " ").trim();
if (singleLine.length <= 160) return singleLine;
if (singleLine.length <= 160) {
return singleLine;
}
return `${singleLine.slice(0, 160)}`;
}
export function logAcceptedEnvOption(option: AcceptedEnvOption): void {
if (process.env.VITEST || process.env.NODE_ENV === "test") return;
if (loggedEnv.has(option.key)) return;
if (process.env.VITEST || process.env.NODE_ENV === "test") {
return;
}
if (loggedEnv.has(option.key)) {
return;
}
const rawValue = option.value ?? process.env[option.key];
if (!rawValue || !rawValue.trim()) return;
if (!rawValue || !rawValue.trim()) {
return;
}
loggedEnv.add(option.key);
log.info(`env: ${option.key}=${formatEnvValue(rawValue, option.redact)} (${option.description})`);
}