chore: object shorthand linting rule (#12152)

chore: object shorthand
This commit is contained in:
Jason Rasmussen
2024-08-30 14:38:53 -04:00
committed by GitHub
parent 40854f358c
commit 5e6ac87eaf
23 changed files with 30 additions and 28 deletions

View File

@@ -13,7 +13,7 @@ export class CreateProfileImageResponseDto {
export function mapCreateProfileImageResponse(userId: string, profileImagePath: string): CreateProfileImageResponseDto {
return {
userId: userId,
profileImagePath: profileImagePath,
userId,
profileImagePath,
};
}

View File

@@ -317,7 +317,7 @@ export class MapRepository implements IMapRepository {
}
const input = createReadStream(filePath);
const lineReader = readLine.createInterface({ input: input });
const lineReader = readLine.createInterface({ input });
const adminMap = new Map<string, string>();
for await (const line of lineReader) {

View File

@@ -239,7 +239,7 @@ export class AlbumService {
throw new BadRequestException('User not found');
}
await this.albumUserRepository.create({ userId: userId, albumId: id, role });
await this.albumUserRepository.create({ userId, albumId: id, role });
await this.eventRepository.emit('album.invite', { id, userId });
}

View File

@@ -46,7 +46,7 @@ const fixtures = {
};
const oauthUserWithDefaultQuota = {
email: email,
email,
name: ' ',
oauthId: sub,
quotaSizeInBytes: 1_073_741_824,
@@ -561,7 +561,7 @@ describe('AuthService', () => {
);
expect(userMock.create).toHaveBeenCalledWith({
email: email,
email,
name: ' ',
oauthId: sub,
quotaSizeInBytes: null,
@@ -581,7 +581,7 @@ describe('AuthService', () => {
);
expect(userMock.create).toHaveBeenCalledWith({
email: email,
email,
name: ' ',
oauthId: sub,
quotaSizeInBytes: 5_368_709_120,

View File

@@ -421,7 +421,7 @@ export class AuthService {
await this.sessionRepository.update({ id: session.id, updatedAt: new Date() });
}
return { user: session.user, session: session };
return { user: session.user, session };
}
throw new UnauthorizedException('Invalid user token');

View File

@@ -339,7 +339,7 @@ export class LibraryService {
const libraryId = job.id;
const assetPagination = usePagination(JOBS_LIBRARY_PAGINATION_SIZE, (pagination) =>
this.assetRepository.getAll(pagination, { libraryId: libraryId, withDeleted: true }),
this.assetRepository.getAll(pagination, { libraryId, withDeleted: true }),
);
let assetsFound = false;
@@ -465,7 +465,7 @@ export class LibraryService {
libraryId: job.id,
checksum: pathHash,
originalPath: assetPath,
deviceAssetId: deviceAssetId,
deviceAssetId,
deviceId: 'Library Import',
fileCreatedAt: stats.mtime,
fileModifiedAt: stats.mtime,

View File

@@ -309,7 +309,7 @@ describe(StorageTemplateService.name, () => {
entityId: assetStub.image.id,
pathType: AssetPathType.ORIGINAL,
oldPath: assetStub.image.originalPath,
newPath: newPath,
newPath,
});
expect(storageMock.rename).toHaveBeenCalledWith(assetStub.image.originalPath, newPath);
expect(storageMock.copyFile).toHaveBeenCalledWith(assetStub.image.originalPath, newPath);

View File

@@ -227,7 +227,7 @@ export class StorageTemplateService {
const storagePath = this.render(this.template.compiled, {
asset,
filename: sanitized,
extension: extension,
extension,
albumName,
});
const fullPath = path.normalize(path.join(rootPath, storagePath));