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

@@ -6,7 +6,9 @@ describe("getShellPathFromLoginShell", () => {
afterEach(() => resetShellPathCacheForTests());
it("returns PATH from login shell env", () => {
if (process.platform === "win32") return;
if (process.platform === "win32") {
return;
}
const exec = vi
.fn()
.mockReturnValue(Buffer.from("PATH=/custom/bin\0HOME=/home/user\0", "utf-8"));
@@ -15,7 +17,9 @@ describe("getShellPathFromLoginShell", () => {
});
it("caches the value", () => {
if (process.platform === "win32") return;
if (process.platform === "win32") {
return;
}
const exec = vi.fn().mockReturnValue(Buffer.from("PATH=/custom/bin\0", "utf-8"));
const env = { SHELL: "/bin/sh" } as NodeJS.ProcessEnv;
expect(getShellPathFromLoginShell({ env, exec })).toBe("/custom/bin");
@@ -24,7 +28,9 @@ describe("getShellPathFromLoginShell", () => {
});
it("returns null on exec failure", () => {
if (process.platform === "win32") return;
if (process.platform === "win32") {
return;
}
const exec = vi.fn(() => {
throw new Error("boom");
});