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

@@ -21,20 +21,26 @@ describe("WizardSession", () => {
const secondPeek = await session.next();
expect(secondPeek.step?.id).toBe(first.step?.id);
if (!first.step) throw new Error("expected first step");
if (!first.step) {
throw new Error("expected first step");
}
await session.answer(first.step.id, null);
const second = await session.next();
expect(second.done).toBe(false);
expect(second.step?.type).toBe("text");
if (!second.step) throw new Error("expected second step");
if (!second.step) {
throw new Error("expected second step");
}
await session.answer(second.step.id, "Peter");
const third = await session.next();
expect(third.step?.type).toBe("note");
if (!third.step) throw new Error("expected third step");
if (!third.step) {
throw new Error("expected third step");
}
await session.answer(third.step.id, null);
const done = await session.next();
@@ -46,7 +52,9 @@ describe("WizardSession", () => {
const session = noteRunner();
const first = await session.next();
await expect(session.answer("bad-id", null)).rejects.toThrow(/wizard: no pending step/i);
if (!first.step) throw new Error("expected first step");
if (!first.step) {
throw new Error("expected first step");
}
await session.answer(first.step.id, null);
});