chore: Enable more lint rules, disable some that trigger a lot. Will clean up later.

This commit is contained in:
cpojer
2026-01-31 16:03:28 +09:00
parent 481f696a87
commit 15792b153f
292 changed files with 643 additions and 699 deletions

View File

@@ -59,8 +59,8 @@ export function collectTelegramUnmentionedGroupIds(
for (const [key, value] of Object.entries(groups)) {
if (key === "*") continue;
if (!value || typeof value !== "object") continue;
if ((value as TelegramGroupConfig).enabled === false) continue;
if ((value as TelegramGroupConfig).requireMention !== false) continue;
if (value.enabled === false) continue;
if (value.requireMention !== false) continue;
const id = String(key).trim();
if (!id) continue;
if (/^-?\d+$/.test(id)) {
@@ -102,9 +102,9 @@ export async function auditTelegramGroupMembership(params: {
const url = `${base}/getChatMember?chat_id=${encodeURIComponent(chatId)}&user_id=${encodeURIComponent(String(params.botId))}`;
const res = await fetchWithTimeout(url, params.timeoutMs, fetcher);
const json = (await res.json()) as TelegramApiOk<{ status?: string }> | TelegramApiErr;
if (!res.ok || !isRecord(json) || json.ok !== true) {
if (!res.ok || !isRecord(json) || !json.ok) {
const desc =
isRecord(json) && json.ok === false && typeof json.description === "string"
isRecord(json) && !json.ok && typeof json.description === "string"
? json.description
: `getChatMember failed (${res.status})`;
groups.push({