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

@@ -26,11 +26,17 @@ function isOptionalToolAllowed(params: {
pluginId: string;
allowlist: Set<string>;
}): boolean {
if (params.allowlist.size === 0) return false;
if (params.allowlist.size === 0) {
return false;
}
const toolName = normalizeToolName(params.toolName);
if (params.allowlist.has(toolName)) return true;
if (params.allowlist.has(toolName)) {
return true;
}
const pluginKey = normalizeToolName(params.pluginId);
if (params.allowlist.has(pluginKey)) return true;
if (params.allowlist.has(pluginKey)) {
return true;
}
return params.allowlist.has("group:plugins");
}
@@ -57,7 +63,9 @@ export function resolvePluginTools(params: {
const blockedPlugins = new Set<string>();
for (const entry of registry.tools) {
if (blockedPlugins.has(entry.pluginId)) continue;
if (blockedPlugins.has(entry.pluginId)) {
continue;
}
const pluginIdKey = normalizeToolName(entry.pluginId);
if (existingNormalized.has(pluginIdKey)) {
const message = `plugin id conflicts with core tool name (${entry.pluginId})`;
@@ -78,7 +86,9 @@ export function resolvePluginTools(params: {
log.error(`plugin tool failed (${entry.pluginId}): ${String(err)}`);
continue;
}
if (!resolved) continue;
if (!resolved) {
continue;
}
const listRaw = Array.isArray(resolved) ? resolved : [resolved];
const list = entry.optional
? listRaw.filter((tool) =>
@@ -89,7 +99,9 @@ export function resolvePluginTools(params: {
}),
)
: listRaw;
if (list.length === 0) continue;
if (list.length === 0) {
continue;
}
const nameSet = new Set<string>();
for (const tool of list) {
if (nameSet.has(tool.name) || existing.has(tool.name)) {