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

@@ -148,7 +148,9 @@ async function handleMissingSandboxImage(
prompter: DoctorPrompter,
) {
const exists = await dockerImageExists(params.image);
if (exists) return;
if (exists) {
return;
}
const buildHint = params.buildScript
? `Build it with ${params.buildScript}.`
@@ -166,7 +168,9 @@ async function handleMissingSandboxImage(
}
}
if (built) return;
if (built) {
return;
}
}
export async function maybeRepairSandboxImages(
@@ -176,7 +180,9 @@ export async function maybeRepairSandboxImages(
): Promise<OpenClawConfig> {
const sandbox = cfg.agents?.defaults?.sandbox;
const mode = sandbox?.mode ?? "off";
if (!sandbox || mode === "off") return cfg;
if (!sandbox || mode === "off") {
return cfg;
}
const dockerAvailable = await isDockerAvailable();
if (!dockerAvailable) {
@@ -238,14 +244,18 @@ export function noteSandboxScopeWarnings(cfg: OpenClawConfig) {
for (const agent of agents) {
const agentId = agent.id;
const agentSandbox = agent.sandbox;
if (!agentSandbox) continue;
if (!agentSandbox) {
continue;
}
const scope = resolveSandboxScope({
scope: agentSandbox.scope ?? globalSandbox?.scope,
perSession: agentSandbox.perSession ?? globalSandbox?.perSession,
});
if (scope !== "shared") continue;
if (scope !== "shared") {
continue;
}
const overrides: string[] = [];
if (agentSandbox.docker && Object.keys(agentSandbox.docker).length > 0) {
@@ -258,7 +268,9 @@ export function noteSandboxScopeWarnings(cfg: OpenClawConfig) {
overrides.push("prune");
}
if (overrides.length === 0) continue;
if (overrides.length === 0) {
continue;
}
warnings.push(
[