fix(api): resolve lint errors

This commit is contained in:
dahyeon committed 2026-07-24 21:52:35 -07:00
1 parent 96fede9fe5
commit fd1fa2366c
42 files changed
+307 -199

No files matched your search

@@ -330,6 +330,9 @@ function legacyAuctionLifecycleId(value: unknown): string {
function stringifyId(value: unknown): string | undefined {
if (value === undefined || value === null) return undefined;
// MongoDB ObjectId and migration fixture IDs intentionally rely on their
// stable string representation.
// eslint-disable-next-line @typescript-eslint/no-base-to-string
return typeof value === 'string' ? value : String(value);
}
@@ -1,11 +1,4 @@
type TournamentCodeState =
| 'available'
| 'reserved'
| 'used'
| 'released'
| 'expired'
| 'voided'
| string;
type TournamentCodeState = string;
type AnyDoc = Record<string, unknown> & { _id: unknown };
type IndexKey = Record<string, 1 | -1>;
@@ -36,7 +29,7 @@ interface MigrationCollection {
$unset?: Record<string, ''>;
},
options?: { ordered?: boolean },
): Promise<{ matchedCount?: number; modifiedCount?: number } | unknown>;
): Promise<unknown>;
indexes?(): Promise<MigrationIndex[]>;
dropIndex?(name: string): Promise<unknown>;
createIndex?(
@@ -516,15 +509,17 @@ function summarizeGroups(
function summarizeCode(doc: TournamentCodeDoc): TournamentCodeDuplicateSummary {
return {
bracketMatchId:
doc.bracketMatchId === undefined ? undefined : String(doc.bracketMatchId),
code: doc.code === undefined ? undefined : String(doc.code),
doc.bracketMatchId === undefined
? undefined
: stringifyId(doc.bracketMatchId),
code: doc.code === undefined ? undefined : stringifyId(doc.code),
gameNumber:
doc.gameNumber === undefined ? undefined : String(doc.gameNumber),
doc.gameNumber === undefined ? undefined : stringifyId(doc.gameNumber),
id: stringifyId(doc._id) ?? '',
matchId: doc.matchId === undefined ? undefined : stringifyId(doc.matchId),
riotMatchId:
doc.riotMatchId === undefined ? undefined : String(doc.riotMatchId),
state: doc.state === undefined ? undefined : String(doc.state),
doc.riotMatchId === undefined ? undefined : stringifyId(doc.riotMatchId),
state: doc.state,
};
}
@@ -749,16 +744,19 @@ function readModifiedCount(result: unknown): number {
}
function hasField(doc: Record<string, unknown>, key: string): boolean {
return Object.prototype.hasOwnProperty.call(doc, key);
return Object.hasOwn(doc, key);
}
function stringifyKeyPart(value: unknown): string {
if (value === null) return '<null>';
if (value === undefined) return '<undefined>';
return stringifyId(value) ?? String(value);
return stringifyId(value) ?? '<unknown>';
}
function stringifyId(value: unknown): string | undefined {
if (value === undefined || value === null) return undefined;
// MongoDB ObjectId and migration fixture IDs intentionally rely on their
// stable string representation.
// eslint-disable-next-line @typescript-eslint/no-base-to-string
return typeof value === 'string' ? value : String(value);
}