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

@@ -20,17 +20,27 @@ export function isMessagingToolDuplicateNormalized(
normalized: string,
normalizedSentTexts: string[],
): boolean {
if (normalizedSentTexts.length === 0) return false;
if (!normalized || normalized.length < MIN_DUPLICATE_TEXT_LENGTH) return false;
if (normalizedSentTexts.length === 0) {
return false;
}
if (!normalized || normalized.length < MIN_DUPLICATE_TEXT_LENGTH) {
return false;
}
return normalizedSentTexts.some((normalizedSent) => {
if (!normalizedSent || normalizedSent.length < MIN_DUPLICATE_TEXT_LENGTH) return false;
if (!normalizedSent || normalizedSent.length < MIN_DUPLICATE_TEXT_LENGTH) {
return false;
}
return normalized.includes(normalizedSent) || normalizedSent.includes(normalized);
});
}
export function isMessagingToolDuplicate(text: string, sentTexts: string[]): boolean {
if (sentTexts.length === 0) return false;
if (sentTexts.length === 0) {
return false;
}
const normalized = normalizeTextForComparison(text);
if (!normalized || normalized.length < MIN_DUPLICATE_TEXT_LENGTH) return false;
if (!normalized || normalized.length < MIN_DUPLICATE_TEXT_LENGTH) {
return false;
}
return isMessagingToolDuplicateNormalized(normalized, sentTexts.map(normalizeTextForComparison));
}