chore: migrate to oxlint and oxfmt

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-14 14:31:43 +00:00
parent 912ebffc63
commit c379191f80
1480 changed files with 28608 additions and 43547 deletions

View File

@@ -1,8 +1,5 @@
import type { ClawdbotConfig } from "../config/config.js";
import type {
DiscordGuildChannelConfig,
DiscordGuildEntry,
} from "../config/types.js";
import type { DiscordGuildChannelConfig, DiscordGuildEntry } from "../config/types.js";
import { resolveDiscordAccount } from "./accounts.js";
import { fetchChannelPermissionsDiscord } from "./send.js";
@@ -27,9 +24,7 @@ function isRecord(value: unknown): value is Record<string, unknown> {
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
}
function shouldAuditChannelConfig(
config: DiscordGuildChannelConfig | undefined,
) {
function shouldAuditChannelConfig(config: DiscordGuildChannelConfig | undefined) {
if (!config) return true;
if (config.allow === false) return false;
if (config.enabled === false) return false;
@@ -48,12 +43,7 @@ function listConfiguredGuildChannelKeys(
for (const [key, value] of Object.entries(channelsRaw)) {
const channelId = String(key).trim();
if (!channelId) continue;
if (
!shouldAuditChannelConfig(
value as DiscordGuildChannelConfig | undefined,
)
)
continue;
if (!shouldAuditChannelConfig(value as DiscordGuildChannelConfig | undefined)) continue;
ids.add(channelId);
}
}