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

@@ -1,8 +1,14 @@
export function extractErrorCode(err: unknown): string | undefined {
if (!err || typeof err !== "object") return undefined;
if (!err || typeof err !== "object") {
return undefined;
}
const code = (err as { code?: unknown }).code;
if (typeof code === "string") return code;
if (typeof code === "number") return String(code);
if (typeof code === "string") {
return code;
}
if (typeof code === "number") {
return String(code);
}
return undefined;
}
@@ -10,7 +16,9 @@ export function formatErrorMessage(err: unknown): string {
if (err instanceof Error) {
return err.message || err.name || "Error";
}
if (typeof err === "string") return err;
if (typeof err === "string") {
return err;
}
if (typeof err === "number" || typeof err === "boolean" || typeof err === "bigint") {
return String(err);
}