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

@@ -12,12 +12,18 @@ export function extractInlineSimpleCommand(body?: string): {
command: string;
cleaned: string;
} | null {
if (!body) return null;
if (!body) {
return null;
}
const match = body.match(INLINE_SIMPLE_COMMAND_RE);
if (!match || match.index === undefined) return null;
if (!match || match.index === undefined) {
return null;
}
const alias = `/${match[1].toLowerCase()}`;
const command = INLINE_SIMPLE_COMMAND_ALIASES.get(alias);
if (!command) return null;
if (!command) {
return null;
}
const cleaned = body.replace(match[0], " ").replace(/\s+/g, " ").trim();
return { command, cleaned };
}
@@ -27,7 +33,9 @@ export function stripInlineStatus(body: string): {
didStrip: boolean;
} {
const trimmed = body.trim();
if (!trimmed) return { cleaned: "", didStrip: false };
if (!trimmed) {
return { cleaned: "", didStrip: false };
}
const cleaned = trimmed.replace(INLINE_STATUS_RE, " ").replace(/\s+/g, " ").trim();
return { cleaned, didStrip: cleaned !== trimmed };
}