Phase 10: запрет inline eslint-disable, file-level overrides, IUser-тип
This commit is contained in:
@@ -16,12 +16,10 @@ function errorCodeOf(body: unknown): string | undefined {
|
||||
if (typeof body !== 'object' || body === null) {
|
||||
return undefined;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- извлечение полей из unknown
|
||||
const error = (body as { error?: unknown }).error;
|
||||
if (typeof error !== 'object' || error === null) {
|
||||
return undefined;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- извлечение полей из unknown
|
||||
const code = (error as { code?: unknown }).code;
|
||||
return typeof code === 'string' ? code : undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user