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

@@ -124,7 +124,9 @@ export async function resolveSystemNodeInfo(params: {
const env = params.env ?? process.env;
const platform = params.platform ?? process.platform;
const systemNode = await resolveSystemNodePath(env, platform);
if (!systemNode) return null;
if (!systemNode) {
return null;
}
const version = await resolveNodeVersion(systemNode, params.execFile ?? execFileAsync);
return {
@@ -138,7 +140,9 @@ export function renderSystemNodeWarning(
systemNode: SystemNodeInfo | null,
selectedNodePath?: string,
): string | null {
if (!systemNode || systemNode.supported) return null;
if (!systemNode || systemNode.supported) {
return null;
}
const versionLabel = systemNode.version ?? "unknown";
const selectedLabel = selectedNodePath ? ` Using ${selectedNodePath} for the daemon.` : "";
return `System Node ${versionLabel} at ${systemNode.path} is below the required Node 22+.${selectedLabel} Install Node 22+ from nodejs.org or Homebrew.`;
@@ -150,8 +154,12 @@ export async function resolvePreferredNodePath(params: {
platform?: NodeJS.Platform;
execFile?: ExecFileAsync;
}): Promise<string | undefined> {
if (params.runtime !== "node") return undefined;
if (params.runtime !== "node") {
return undefined;
}
const systemNode = await resolveSystemNodeInfo(params);
if (!systemNode?.supported) return undefined;
if (!systemNode?.supported) {
return undefined;
}
return systemNode.path;
}