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

@@ -16,7 +16,7 @@ export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }
if (!item || item.type !== "message") return;
const channelInfo = item.channel ? await ctx.resolveChannelName(item.channel) : {};
const channelType = channelInfo?.type as SlackMessageEvent["channel_type"];
const channelType = channelInfo?.type;
if (
!ctx.isChannelAllowed({
channelId: item.channel,

View File

@@ -7,7 +7,6 @@ import { DEFAULT_GROUP_HISTORY_LIMIT } from "../../auto-reply/reply/history.js";
import { mergeAllowlist, summarizeMapping } from "../../channels/allowlists/resolve-utils.js";
import { loadConfig } from "../../config/config.js";
import type { SessionScope } from "../../config/sessions.js";
import type { DmPolicy, GroupPolicy } from "../../config/types.js";
import { warn } from "../../globals.js";
import { normalizeMainKey } from "../../routing/session-key.js";
import type { RuntimeEnv } from "../../runtime.js";
@@ -91,13 +90,13 @@ export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
const dmConfig = slackCfg.dm;
const dmEnabled = dmConfig?.enabled ?? true;
const dmPolicy = (dmConfig?.policy ?? "pairing") as DmPolicy;
const dmPolicy = dmConfig?.policy ?? "pairing";
let allowFrom = dmConfig?.allowFrom;
const groupDmEnabled = dmConfig?.groupEnabled ?? false;
const groupDmChannels = dmConfig?.groupChannels;
let channelsConfig = slackCfg.channels;
const defaultGroupPolicy = cfg.channels?.defaults?.groupPolicy;
const groupPolicy = (slackCfg.groupPolicy ?? defaultGroupPolicy ?? "open") as GroupPolicy;
const groupPolicy = slackCfg.groupPolicy ?? defaultGroupPolicy ?? "open";
if (
slackCfg.groupPolicy === undefined &&
slackCfg.channels === undefined &&

View File

@@ -589,7 +589,7 @@ export function registerSlackMonitorSlashCommands(params: {
await handleSlashCommand({
command: commandPayload,
ack: async () => {},
respond: respondFn as SlackCommandMiddlewareArgs["respond"],
respond: respondFn,
prompt,
commandArgs,
commandDefinition: commandDefinition ?? undefined,

View File

@@ -72,7 +72,7 @@ export function createSlackThreadTsResolver(params: {
return;
}
while (cache.size > maxSize) {
const oldestKey = cache.keys().next().value as string | undefined;
const oldestKey = cache.keys().next().value;
if (!oldestKey) break;
cache.delete(oldestKey);
}