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

@@ -15,11 +15,15 @@ function resolveHomeDir(): string {
}
export async function noteMacLaunchAgentOverrides() {
if (process.platform !== "darwin") return;
if (process.platform !== "darwin") {
return;
}
const home = resolveHomeDir();
const markerCandidates = [path.join(home, ".openclaw", "disable-launchagent")];
const markerPath = markerCandidates.find((candidate) => fs.existsSync(candidate));
if (!markerPath) return;
if (!markerPath) {
return;
}
const displayMarkerPath = shortenHomePath(markerPath);
const lines = [
@@ -61,8 +65,12 @@ export async function noteMacLaunchctlGatewayEnvOverrides(
},
) {
const platform = deps?.platform ?? process.platform;
if (platform !== "darwin") return;
if (!hasConfigGatewayCreds(cfg)) return;
if (platform !== "darwin") {
return;
}
if (!hasConfigGatewayCreds(cfg)) {
return;
}
const getenv = deps?.getenv ?? launchctlGetenv;
const deprecatedLaunchctlEntries = [
@@ -94,7 +102,9 @@ export async function noteMacLaunchctlGatewayEnvOverrides(
const envPassword = passwordEntry?.[1]?.trim() ?? "";
const envTokenKey = tokenEntry?.[0];
const envPasswordKey = passwordEntry?.[0];
if (!envToken && !envPassword) return;
if (!envToken && !envPassword) {
return;
}
const lines = [
"- launchctl environment overrides detected (can cause confusing unauthorized errors).",
@@ -122,7 +132,9 @@ export function noteDeprecatedLegacyEnvVars(
(key.startsWith("MOLTBOT_") || key.startsWith("CLAWDBOT_")) && value?.trim(),
)
.map(([key]) => key);
if (entries.length === 0) return;
if (entries.length === 0) {
return;
}
const lines = [
"- Deprecated legacy environment variables detected (ignored).",