From 81b636ccc9e7dd1488942245d2bbdb9e232d301b Mon Sep 17 00:00:00 2001 From: Diomonogatari Date: Thu, 17 Oct 2024 23:02:40 +0100 Subject: [PATCH] fix: resolve lint errors in lemmyContentAggregatorService --- .prettierrc | 3 ++- index.ts | 2 +- infrastructure/service/lemmyContentAggregatorService.ts | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.prettierrc b/.prettierrc index b27104b..f9eedc5 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": false, - "printWidth": 120 + "printWidth": 120, + "trailingComma": "es5" } diff --git a/index.ts b/index.ts index 95dcdce..ba97632 100644 --- a/index.ts +++ b/index.ts @@ -58,7 +58,7 @@ const checkForNewPosts = async () => { }; last5MinutesPosts.forEach((post) => { - const title = avoidEmbedInLink(post!.getTitle()); + const title = avoidEmbedInLink(post.getTitle()); const message = `Novo post no Lemmy: **${title}** (*${post?.getAuthorName()}*) diff --git a/infrastructure/service/lemmyContentAggregatorService.ts b/infrastructure/service/lemmyContentAggregatorService.ts index fc8342f..aaf0f46 100644 --- a/infrastructure/service/lemmyContentAggregatorService.ts +++ b/infrastructure/service/lemmyContentAggregatorService.ts @@ -11,7 +11,7 @@ export default class LemmyContentAggregatorService implements ContentAggregatorS const response = await fetch(this.feedUrl); const data = await response.json(); - + unpinnedPosts = data.posts .filter((item: any) => !item.post.featured_community && !item.post.featured_local) .map( @@ -24,7 +24,9 @@ export default class LemmyContentAggregatorService implements ContentAggregatorS createdAt: new Date(item.post.published), }) ); - } catch (e) {} + } catch (e) { + // Ignoring for now. + } return unpinnedPosts; }