chore(lint): biome cleanup across services — format, sort imports, drop unused
- discord-gateway: 74 lint errors -> 0 (format, import sorting, unused imports/vars, dead breath var) - backend: format + sort imports (11 warnings left: noExplicitAny) - frontend: remove unused imports, drop dead breathing var, fix useExhaustiveDependencies (scroll keyed on messages), a11y biome-ignore for drag surface + stopPropagation container (mouse-only gestures) - remaining warnings are false positives: index keys on static lists, <img> in static export (next/image unsupported), noExplicitAny tsc --noEmit clean on all 3 services; vitest green (60+36).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import { and, desc, eq, inArray, type SQL } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import { attachmentsTable } from "../../shared/database/schema.js";
|
||||
import type { AttachmentRecord } from "../message-capture/types.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createChildLogger } from "@/shared/logger/index";
|
||||
import type { Client, Message } from "discord.js-selfbot-v13";
|
||||
import { createChildLogger } from "@/shared/logger/index";
|
||||
import { config } from "../../shared/config/config.js";
|
||||
import { queueMessageAnalysis } from "../ai-moderation/aiAnalyzer.js";
|
||||
import { processAttachmentUpload } from "../attachment-upload/attachmentUploader.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import { getDatabase } from "../../shared/database/drizzle.js";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import type {
|
||||
@@ -327,7 +327,9 @@ export const messageStore: MessageStore = new Proxy<MessageStore>(
|
||||
{
|
||||
get(_, prop: string | symbol) {
|
||||
const store = resolveStore();
|
||||
const value = (store as unknown as Record<string | symbol, unknown>)[prop];
|
||||
const value = (store as unknown as Record<string | symbol, unknown>)[
|
||||
prop
|
||||
];
|
||||
return typeof value === "function" ? value.bind(store) : value;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import { and, asc, desc, eq, inArray, isNull, or, sql } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import { messagesTable } from "../../shared/database/schema.js";
|
||||
import type { MessageRecord } from "../message-capture/types.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import { and, eq, isNull, sql } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import { messagesTable } from "../../shared/database/schema.js";
|
||||
import type { MessageRecord } from "../message-capture/types.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import { and, desc, eq, or, type SQL } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import {
|
||||
messageEditsTable,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import type {
|
||||
MessageQuery,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { buildCursorCondition, pageResult } from "../../shared/index.js";
|
||||
import { createChildLogger, type Logger } from "../../shared/logger/index.js";
|
||||
import { and, desc, eq, inArray, type SQL, sql } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import { messagesTable } from "../../shared/database/schema.js";
|
||||
import { buildCursorCondition, pageResult } from "../../shared/index.js";
|
||||
import { createChildLogger, type Logger } from "../../shared/logger/index.js";
|
||||
import type {
|
||||
MessageQuery,
|
||||
MessageRecord,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import { and, desc, eq, isNull, or, type SQL, sql } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import { messagesTable } from "../../shared/database/schema.js";
|
||||
import type { MessageRecord } from "../message-capture/types.js";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { buildCursorCondition, pageResult } from "../../shared/index.js";
|
||||
import { createChildLogger, type Logger } from "../../shared/logger/index.js";
|
||||
import { and, desc, eq, inArray, type SQL, sql } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import { moderationActionsTable } from "../../shared/database/schema.js";
|
||||
import { buildCursorCondition, pageResult } from "../../shared/index.js";
|
||||
import { createChildLogger, type Logger } from "../../shared/logger/index.js";
|
||||
import type { ModerationAction, PageResult } from "../message-capture/types.js";
|
||||
|
||||
// ─── ModerationActionsDb Class ──────────────────────────────────────────────
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import { and, eq, isNull, or } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import { createChildLogger, type Logger } from "@/shared/logger/index";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import { retentionPoliciesTable } from "../../shared/database/schema.js";
|
||||
import type { RetentionPolicy } from "../message-capture/types.js";
|
||||
@@ -45,8 +45,7 @@ export class RetentionDb {
|
||||
),
|
||||
);
|
||||
|
||||
if (channelRows.length > 0)
|
||||
return channelRows[0] as RetentionPolicy;
|
||||
if (channelRows.length > 0) return channelRows[0] as RetentionPolicy;
|
||||
}
|
||||
|
||||
// Fall back to the guild default (channel_id IS NULL)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { buildCursorCondition, pageResult } from "../../shared/index.js";
|
||||
import { createChildLogger, type Logger } from "../../shared/logger/index.js";
|
||||
import { and, desc, eq, inArray, type SQL, sql } from "drizzle-orm";
|
||||
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
||||
import type * as schema from "../../shared/database/schema.js";
|
||||
import { messageReviewsTable } from "../../shared/database/schema.js";
|
||||
import { buildCursorCondition, pageResult } from "../../shared/index.js";
|
||||
import { createChildLogger, type Logger } from "../../shared/logger/index.js";
|
||||
import type { MessageReview, PageResult } from "../message-capture/types.js";
|
||||
|
||||
// ─── ReviewsDb Class ────────────────────────────────────────────────────────
|
||||
@@ -94,7 +94,9 @@ export class ReviewsDb {
|
||||
conditions.push(
|
||||
inArray(
|
||||
messageReviewsTable.status,
|
||||
query.status as Array<"pending" | "approved" | "rejected" | "escalated">,
|
||||
query.status as Array<
|
||||
"pending" | "approved" | "rejected" | "escalated"
|
||||
>,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type fs from "node:fs";
|
||||
import type prism from "prism-media";
|
||||
import type {
|
||||
AnalysisQueueStatus,
|
||||
AttachmentRecord,
|
||||
@@ -6,7 +7,6 @@ import type {
|
||||
UserMetadata,
|
||||
VoiceRecordingUploadData,
|
||||
} from "../../shared/index.js";
|
||||
import type prism from "prism-media";
|
||||
|
||||
// Re-export all shared types for backward compatibility
|
||||
export type {
|
||||
|
||||
Reference in New Issue
Block a user