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

@@ -22,7 +22,9 @@ function normalizeAvatarValue(value: string | undefined | null): string | null {
function resolveAvatarSource(cfg: OpenClawConfig, agentId: string): string | null {
const fromConfig = normalizeAvatarValue(resolveAgentIdentity(cfg, agentId)?.avatar);
if (fromConfig) return fromConfig;
if (fromConfig) {
return fromConfig;
}
const workspace = resolveAgentWorkspaceDir(cfg, agentId);
const fromIdentity = normalizeAvatarValue(loadAgentIdentityFromWorkspace(workspace)?.avatar);
return fromIdentity;
@@ -47,7 +49,9 @@ function resolveExistingPath(value: string): string {
function isPathWithin(root: string, target: string): boolean {
const relative = path.relative(root, target);
if (!relative) return true;
if (!relative) {
return true;
}
return !relative.startsWith("..") && !path.isAbsolute(relative);
}