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

@@ -4,9 +4,15 @@ import type { NativeCommandsSetting } from "./types.js";
function resolveAutoDefault(providerId?: ChannelId): boolean {
const id = normalizeChannelId(providerId);
if (!id) return false;
if (id === "discord" || id === "telegram") return true;
if (id === "slack") return false;
if (!id) {
return false;
}
if (id === "discord" || id === "telegram") {
return true;
}
if (id === "slack") {
return false;
}
return false;
}
@@ -17,8 +23,12 @@ export function resolveNativeSkillsEnabled(params: {
}): boolean {
const { providerId, providerSetting, globalSetting } = params;
const setting = providerSetting === undefined ? globalSetting : providerSetting;
if (setting === true) return true;
if (setting === false) return false;
if (setting === true) {
return true;
}
if (setting === false) {
return false;
}
return resolveAutoDefault(providerId);
}
@@ -29,8 +39,12 @@ export function resolveNativeCommandsEnabled(params: {
}): boolean {
const { providerId, providerSetting, globalSetting } = params;
const setting = providerSetting === undefined ? globalSetting : providerSetting;
if (setting === true) return true;
if (setting === false) return false;
if (setting === true) {
return true;
}
if (setting === false) {
return false;
}
// auto or undefined -> heuristic
return resolveAutoDefault(providerId);
}
@@ -40,7 +54,11 @@ export function isNativeCommandsExplicitlyDisabled(params: {
globalSetting?: NativeCommandsSetting;
}): boolean {
const { providerSetting, globalSetting } = params;
if (providerSetting === false) return true;
if (providerSetting === undefined) return globalSetting === false;
if (providerSetting === false) {
return true;
}
if (providerSetting === undefined) {
return globalSetting === false;
}
return false;
}