chore: finish migrating eslint config files; bump unicorn (#17200)

This commit is contained in:
Daniel Dietzler 2025-03-31 13:18:25 +02:00 committed by GitHub
parent e4f83680d9
commit 238c151ac3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 883 additions and 1286 deletions

View file

@ -121,7 +121,7 @@ class SqlGenerator {
for (const key of this.getPropertyNames(instance)) {
const target = instance[key];
if (!(target instanceof Function)) {
if (!(typeof target === 'function')) {
continue;
}

View file

@ -91,7 +91,9 @@ export class MachineLearningRepository {
signal: AbortSignal.timeout(MACHINE_LEARNING_PING_TIMEOUT),
});
active = response.ok;
} catch {}
} catch {
// nothing to do here
}
this.setUrlAvailability(url, active);
return active;
}

View file

@ -6,6 +6,7 @@ describe(NotificationRepository.name, () => {
let sut: NotificationRepository;
beforeEach(() => {
// eslint-disable-next-line no-sparse-arrays
sut = new NotificationRepository(automock(LoggingRepository, { args: [, { getEnv: () => ({}) }], strict: false }));
});

View file

@ -84,7 +84,7 @@ export class PersonRepository {
.$if(!!faceIds, (qb) => qb.where('asset_faces.id', 'in', faceIds!))
.executeTakeFirst();
return Number(result.numChangedRows) ?? 0;
return Number(result.numChangedRows ?? 0);
}
@GenerateSql({ params: [{ sourceType: SourceType.EXIF }] })
@ -269,7 +269,7 @@ export class PersonRepository {
.where('asset_faces.id', '=', assetFaceId)
.executeTakeFirst();
return Number(result.numChangedRows) ?? 0;
return Number(result.numChangedRows ?? 0);
}
getById(personId: string): Promise<PersonEntity | null> {

View file

@ -183,6 +183,7 @@ describe(StorageRepository.name, () => {
let sut: StorageRepository;
beforeEach(() => {
// eslint-disable-next-line no-sparse-arrays
sut = new StorageRepository(automock(LoggingRepository, { args: [, { getEnv: () => ({}) }], strict: false }));
});

View file

@ -236,7 +236,6 @@ export class UserRepository {
stat.usage = Number(stat.usage);
stat.usagePhotos = Number(stat.usagePhotos);
stat.usageVideos = Number(stat.usageVideos);
stat.quotaSizeInBytes = stat.quotaSizeInBytes;
}
return stats;

View file

@ -103,7 +103,9 @@ export class ApiService {
break;
}
}
} catch {}
} catch {
// nothing to do here
}
res.type('text/html').header('Cache-Control', 'no-store').send(html);
};

View file

@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common';
import { default as path } from 'node:path';
import path from 'node:path';
import semver from 'semver';
import { StorageCore } from 'src/cores/storage.core';
import { OnEvent, OnJob } from 'src/decorators';

View file

@ -250,10 +250,6 @@ const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRe
return access.memory.checkOwnerAccess(auth.user.id, ids);
}
case Permission.MEMORY_DELETE: {
return access.memory.checkOwnerAccess(auth.user.id, ids);
}
case Permission.PERSON_READ: {
return await access.person.checkOwnerAccess(auth.user.id, ids);
}