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

@@ -71,7 +71,9 @@ export function mergeHookPresets(existing: string[] | undefined, preset: string)
export function normalizeHooksPath(raw?: string): string {
const base = raw?.trim() || DEFAULT_HOOKS_PATH;
if (base === "/") return DEFAULT_HOOKS_PATH;
if (base === "/") {
return DEFAULT_HOOKS_PATH;
}
const withSlash = base.startsWith("/") ? base : `/${base}`;
return withSlash.replace(/\/+$/, "");
}
@@ -80,7 +82,9 @@ export function normalizeServePath(raw?: string): string {
const base = raw?.trim() || DEFAULT_GMAIL_SERVE_PATH;
// Tailscale funnel/serve strips the set-path prefix before proxying.
// To accept requests at /<path> externally, gog must listen on "/".
if (base === "/") return "/";
if (base === "/") {
return "/";
}
const withSlash = base.startsWith("/") ? base : `/${base}`;
return withSlash.replace(/\/+$/, "");
}
@@ -253,7 +257,9 @@ export function buildTopicPath(projectId: string, topicName: string): string {
export function parseTopicPath(topic: string): { projectId: string; topicName: string } | null {
const match = topic.trim().match(/^projects\/([^/]+)\/topics\/([^/]+)$/i);
if (!match) return null;
if (!match) {
return null;
}
return { projectId: match[1] ?? "", topicName: match[2] ?? "" };
}