From 8f9ce23e521d15ff1d7796d637d5bd64d9ee4375 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Fri, 17 Feb 2023 02:56:59 +0100 Subject: [PATCH] style(backend): fix all eslint errors (#9967) --- packages/backend/src/core/ImageProcessingService.ts | 2 +- packages/backend/src/core/PushNotificationService.ts | 1 - packages/backend/src/core/VideoProcessingService.ts | 2 +- packages/backend/src/core/entities/EmojiEntityService.ts | 2 +- packages/backend/src/server/FileServerService.ts | 6 +++--- packages/backend/src/server/api/endpoints/admin/ad/list.ts | 2 +- .../backend/src/server/api/endpoints/admin/emoji/delete.ts | 2 +- .../backend/src/server/api/endpoints/admin/emoji/update.ts | 4 ++-- packages/backend/src/server/api/endpoints/notes/create.ts | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/backend/src/core/ImageProcessingService.ts b/packages/backend/src/core/ImageProcessingService.ts index fbc02f504..7c88f5e9a 100644 --- a/packages/backend/src/core/ImageProcessingService.ts +++ b/packages/backend/src/core/ImageProcessingService.ts @@ -107,7 +107,7 @@ export class ImageProcessingService { withoutEnlargement: true, }) .rotate() - .webp(options) + .webp(options); return { data, diff --git a/packages/backend/src/core/PushNotificationService.ts b/packages/backend/src/core/PushNotificationService.ts index aff233a3e..75bf4b0e0 100644 --- a/packages/backend/src/core/PushNotificationService.ts +++ b/packages/backend/src/core/PushNotificationService.ts @@ -40,7 +40,6 @@ function truncateBody(type: T, body: pus }, } : {}), }; - } @Injectable() diff --git a/packages/backend/src/core/VideoProcessingService.ts b/packages/backend/src/core/VideoProcessingService.ts index dd6c51c21..eccfeb0e7 100644 --- a/packages/backend/src/core/VideoProcessingService.ts +++ b/packages/backend/src/core/VideoProcessingService.ts @@ -53,7 +53,7 @@ export class VideoProcessingService { thumbnail: '1', url, }) - ) + ); } } diff --git a/packages/backend/src/core/entities/EmojiEntityService.ts b/packages/backend/src/core/entities/EmojiEntityService.ts index cf5637a67..f4a01ab03 100644 --- a/packages/backend/src/core/entities/EmojiEntityService.ts +++ b/packages/backend/src/core/entities/EmojiEntityService.ts @@ -22,7 +22,7 @@ export class EmojiEntityService { src: Emoji['id'] | Emoji, opts: { omitHost?: boolean; omitId?: boolean; withUrl?: boolean; } = { omitHost: true, omitId: true, withUrl: true }, ): Promise> { - opts = { omitHost: true, omitId: true, withUrl: true, ...opts } + opts = { omitHost: true, omitId: true, withUrl: true, ...opts }; const emoji = typeof src === 'object' ? src : await this.emojisRepository.findOneByOrFail({ id: src }); diff --git a/packages/backend/src/server/FileServerService.ts b/packages/backend/src/server/FileServerService.ts index f4bc568fd..c12ae9b82 100644 --- a/packages/backend/src/server/FileServerService.ts +++ b/packages/backend/src/server/FileServerService.ts @@ -395,7 +395,7 @@ export class FileServerService { state: 'remote', mime, ext, path, cleanup, - } + }; } catch (e) { cleanup(); throw e; @@ -429,7 +429,7 @@ export class FileServerService { url: file.uri, fileRole: isThumbnail ? 'thumbnail' : isWebpublic ? 'webpublic' : 'original', file, - } + }; } const path = this.internalStorageService.resolvePath(key); @@ -452,6 +452,6 @@ export class FileServerService { mime: file.type, ext: null, path, - } + }; } } diff --git a/packages/backend/src/server/api/endpoints/admin/ad/list.ts b/packages/backend/src/server/api/endpoints/admin/ad/list.ts index 905036c40..0b6d00605 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/list.ts @@ -31,7 +31,7 @@ export default class extends Endpoint { private queryService: QueryService, ) { super(meta, paramDef, async (ps, me) => { - const query = this.queryService.makePaginationQuery(this.adsRepository.createQueryBuilder('ad'), ps.sinceId, ps.untilId) + const query = this.queryService.makePaginationQuery(this.adsRepository.createQueryBuilder('ad'), ps.sinceId, ps.untilId); const ads = await query.take(ps.limit).getMany(); return ads; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts index c1a60a277..c51e7fd1a 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts @@ -57,7 +57,7 @@ export default class extends Endpoint { await this.db.queryResultCache!.remove(['meta_emojis']); this.globalEventService.publishBroadcastStream('emojiDeleted', { - emojis: [ await this.emojiEntityService.pack(emoji) ], + emojis: [await this.emojiEntityService.pack(emoji)], }); this.moderationLogService.insertModerationLog(me, 'deleteEmoji', { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts index 22bedc710..af610ddf9 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -72,11 +72,11 @@ export default class extends Endpoint { if (emoji.name === ps.name) { this.globalEventService.publishBroadcastStream('emojiUpdated', { - emojis: [ updated ], + emojis: [updated], }); } else { this.globalEventService.publishBroadcastStream('emojiDeleted', { - emojis: [ await this.emojiEntityService.pack(emoji) ], + emojis: [await this.emojiEntityService.pack(emoji)], }); this.globalEventService.publishBroadcastStream('emojiAdded', { diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 700921cd9..593444968 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -280,7 +280,7 @@ export default class extends Endpoint { files: files, poll: ps.poll ? { choices: ps.poll.choices, - multiple: ps.poll.multiple || false, + multiple: ps.poll.multiple ?? false, expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null, } : undefined, text: ps.text ?? undefined,