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,10 +26,16 @@ type ParsedTtsCommand = {
function parseTtsCommand(normalized: string): ParsedTtsCommand | null {
// Accept `/tts` and `/tts <action> [args]` as a single control surface.
if (normalized === "/tts") return { action: "status", args: "" };
if (!normalized.startsWith("/tts ")) return null;
if (normalized === "/tts") {
return { action: "status", args: "" };
}
if (!normalized.startsWith("/tts ")) {
return null;
}
const rest = normalized.slice(5).trim();
if (!rest) return { action: "status", args: "" };
if (!rest) {
return { action: "status", args: "" };
}
const [action, ...tail] = rest.split(/\s+/);
return { action: action.toLowerCase(), args: tail.join(" ").trim() };
}
@@ -63,9 +69,13 @@ function ttsUsage(): ReplyPayload {
}
export const handleTtsCommands: CommandHandler = async (params, allowTextCommands) => {
if (!allowTextCommands) return null;
if (!allowTextCommands) {
return null;
}
const parsed = parseTtsCommand(params.command.commandBodyNormalized);
if (!parsed) return null;
if (!parsed) {
return null;
}
if (!params.command.isAuthorizedSender) {
logVerbose(