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

@@ -167,7 +167,9 @@ vi.mock("../auto-reply/reply.js", () => {
const getOnHandler = (event: string) => {
const handler = onSpy.mock.calls.find((call) => call[0] === event)?.[1];
if (!handler) throw new Error(`Missing handler for event: ${event}`);
if (!handler) {
throw new Error(`Missing handler for event: ${event}`);
}
return handler as (ctx: Record<string, unknown>) => Promise<void>;
};
@@ -2339,7 +2341,9 @@ describe("createTelegramBot", () => {
const handler = commandSpy.mock.calls.find((call) => call[0] === "status")?.[1] as
| ((ctx: Record<string, unknown>) => Promise<void>)
| undefined;
if (!handler) throw new Error("status command handler missing");
if (!handler) {
throw new Error("status command handler missing");
}
await handler({
message: {
@@ -2380,7 +2384,9 @@ describe("createTelegramBot", () => {
const handler = commandSpy.mock.calls.find((call) => call[0] === "status")?.[1] as
| ((ctx: Record<string, unknown>) => Promise<void>)
| undefined;
if (!handler) throw new Error("status command handler missing");
if (!handler) {
throw new Error("status command handler missing");
}
await handler({
message: {
@@ -2422,7 +2428,9 @@ describe("createTelegramBot", () => {
const handler = commandSpy.mock.calls.find((call) => call[0] === "status")?.[1] as
| ((ctx: Record<string, unknown>) => Promise<void>)
| undefined;
if (!handler) throw new Error("status command handler missing");
if (!handler) {
throw new Error("status command handler missing");
}
await handler({
message: {
@@ -2467,7 +2475,9 @@ describe("createTelegramBot", () => {
const verboseHandler = commandSpy.mock.calls.find((call) => call[0] === "verbose")?.[1] as
| ((ctx: Record<string, unknown>) => Promise<void>)
| undefined;
if (!verboseHandler) throw new Error("verbose command handler missing");
if (!verboseHandler) {
throw new Error("verbose command handler missing");
}
await verboseHandler({
message: {