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

@@ -42,10 +42,18 @@ function buildScopeSelection(opts: UninstallOptions): {
} {
const hadExplicit = Boolean(opts.all || opts.service || opts.state || opts.workspace || opts.app);
const scopes = new Set<UninstallScope>();
if (opts.all || opts.service) scopes.add("service");
if (opts.all || opts.state) scopes.add("state");
if (opts.all || opts.workspace) scopes.add("workspace");
if (opts.all || opts.app) scopes.add("app");
if (opts.all || opts.service) {
scopes.add("service");
}
if (opts.all || opts.state) {
scopes.add("state");
}
if (opts.all || opts.workspace) {
scopes.add("workspace");
}
if (opts.all || opts.app) {
scopes.add("app");
}
return { scopes, hadExplicit };
}
@@ -81,7 +89,9 @@ async function stopAndUninstallService(runtime: RuntimeEnv): Promise<boolean> {
}
async function removeMacApp(runtime: RuntimeEnv, dryRun?: boolean) {
if (process.platform !== "darwin") return;
if (process.platform !== "darwin") {
return;
}
await removePath("/Applications/OpenClaw.app", runtime, {
dryRun,
label: "/Applications/OpenClaw.app",
@@ -126,7 +136,9 @@ export async function uninstallCommand(runtime: RuntimeEnv, opts: UninstallOptio
runtime.exit(0);
return;
}
for (const value of selection) scopes.add(value);
for (const value of selection) {
scopes.add(value);
}
}
if (scopes.size === 0) {