Phase 10: запрет inline eslint-disable, file-level overrides, IUser-тип

This commit is contained in:
Suslov-MD
2026-08-16 17:06:45 +00:00
parent 65c44f570c
commit dad4642197
22 changed files with 144 additions and 67 deletions
-3
View File
@@ -22,7 +22,6 @@ function fieldOf(obj: unknown, key: string): string | undefined {
if (typeof obj !== 'object' || obj === null) {
return undefined;
}
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions, @typescript-eslint/no-unsafe-type-assertion -- извлечение полей из unknown
const record = obj as Record<string, unknown>;
const value = record[key];
return typeof value === 'string' ? value : undefined;
@@ -48,7 +47,6 @@ function userEmailOf(body: unknown): string | undefined {
if (typeof body !== 'object' || body === null) {
return undefined;
}
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions, @typescript-eslint/no-unsafe-type-assertion -- извлечение полей из unknown
const record = body as Record<string, unknown>;
// /me возвращает { id, email } на верхнем уровне, register/login — { user: { id, email } }
if (record.email !== undefined) {
@@ -67,7 +65,6 @@ function userIdOf(body: unknown): string | undefined {
if (typeof body !== 'object' || body === null) {
return undefined;
}
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions, @typescript-eslint/no-unsafe-type-assertion -- извлечение полей из unknown
const user = (body as Record<string, unknown>).user;
return fieldOf(user, 'id');
}