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

@@ -83,13 +83,17 @@ function pickBackendConfig(
normalizedId: string,
): CliBackendConfig | undefined {
for (const [key, entry] of Object.entries(config)) {
if (normalizeBackendKey(key) === normalizedId) return entry;
if (normalizeBackendKey(key) === normalizedId) {
return entry;
}
}
return undefined;
}
function mergeBackendConfig(base: CliBackendConfig, override?: CliBackendConfig): CliBackendConfig {
if (!override) return { ...base };
if (!override) {
return { ...base };
}
return {
...base,
...override,
@@ -126,18 +130,26 @@ export function resolveCliBackendConfig(
if (normalized === "claude-cli") {
const merged = mergeBackendConfig(DEFAULT_CLAUDE_BACKEND, override);
const command = merged.command?.trim();
if (!command) return null;
if (!command) {
return null;
}
return { id: normalized, config: { ...merged, command } };
}
if (normalized === "codex-cli") {
const merged = mergeBackendConfig(DEFAULT_CODEX_BACKEND, override);
const command = merged.command?.trim();
if (!command) return null;
if (!command) {
return null;
}
return { id: normalized, config: { ...merged, command } };
}
if (!override) return null;
if (!override) {
return null;
}
const command = override.command?.trim();
if (!command) return null;
if (!command) {
return null;
}
return { id: normalized, config: { ...override, command } };
}