diff --git a/.oxlintrc.json b/.oxlintrc.json index 7f2d7660d6..d807af3b95 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -87,6 +87,7 @@ "import/no-named-as-default": "off", "import/no-named-as-default-member": "off", "typescript/consistent-type-imports": "error", + "typescript/no-floating-promises": "error", "no-unused-vars": [ "error", { diff --git a/app/components/Reactions/Reaction.tsx b/app/components/Reactions/Reaction.tsx index 59829ebf02..e97fa9f449 100644 --- a/app/components/Reactions/Reaction.tsx +++ b/app/components/Reactions/Reaction.tsx @@ -49,13 +49,15 @@ const useTooltipContent = ({ ); // If the emoji is a custom emoji ID, we need to get its short name for display - if (isUUID(emoji)) { - emojis.fetch(emoji).then((ce) => { - if (ce) { - setTransformedEmoji(ce.shortName); - } - }); - } + React.useEffect(() => { + if (isUUID(emoji)) { + void emojis.fetch(emoji).then((ce) => { + if (ce) { + setTransformedEmoji(ce.shortName); + } + }); + } + }, [emoji, emojis]); if (!reactedUsers.length) { return; diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index 83f57e912d..79251b7b92 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -229,7 +229,7 @@ const Sidebar = React.forwardRef(function Sidebar_( ); const handleCloseSidebar = () => { - trigger("light"); + void trigger("light"); ui.toggleMobileSidebar(); }; diff --git a/app/scenes/Collection/components/Overview.tsx b/app/scenes/Collection/components/Overview.tsx index e26032a45f..cd906d9835 100644 --- a/app/scenes/Collection/components/Overview.tsx +++ b/app/scenes/Collection/components/Overview.tsx @@ -50,7 +50,7 @@ function Overview({ collection, readOnly }: Props) { useEffect( () => () => { - handleSave.flush(); + void handleSave.flush(); }, [handleSave] ); diff --git a/app/scenes/Collection/index.tsx b/app/scenes/Collection/index.tsx index 16e58eb793..10d239feab 100644 --- a/app/scenes/Collection/index.tsx +++ b/app/scenes/Collection/index.tsx @@ -364,7 +364,7 @@ const Content = styled.div` const RecentDocuments = observer( ({ collection, documents }: { collection: Collection; documents: any }) => { useEffect(() => { - collection.fetchDocuments(); + void collection.fetchDocuments(); }, [collection]); return ( diff --git a/app/scenes/Document/components/MultiplayerEditor.tsx b/app/scenes/Document/components/MultiplayerEditor.tsx index 45a467db31..fc611ba12f 100644 --- a/app/scenes/Document/components/MultiplayerEditor.tsx +++ b/app/scenes/Document/components/MultiplayerEditor.tsx @@ -121,7 +121,7 @@ function MultiplayerEditor({ onSynced, ...props }: Props, ref: any) { provider.shouldConnect = false; retryCount.current++; - sleep(retryCount.current * 1000 - 1000).then(() => + void sleep(retryCount.current * 1000 - 1000).then(() => auth .fetchAuth() .then(() => { diff --git a/server/collaboration/APIUpdateExtension.ts b/server/collaboration/APIUpdateExtension.ts index ea4156fe3b..19134544fd 100644 --- a/server/collaboration/APIUpdateExtension.ts +++ b/server/collaboration/APIUpdateExtension.ts @@ -66,7 +66,7 @@ export class APIUpdateExtension implements Extension { }); // Subscribe to the API update channel pattern - this.subscriber.psubscribe(`${CHANNEL_PREFIX}:*`, (err) => { + await this.subscriber.psubscribe(`${CHANNEL_PREFIX}:*`, (err) => { if (err) { Logger.error("Failed to subscribe to API update channel", err); return; diff --git a/server/queues/tasks/ShareSubscriptionNotificationsTask.ts b/server/queues/tasks/ShareSubscriptionNotificationsTask.ts index abb1a48fa3..84b11e7f76 100644 --- a/server/queues/tasks/ShareSubscriptionNotificationsTask.ts +++ b/server/queues/tasks/ShareSubscriptionNotificationsTask.ts @@ -73,7 +73,7 @@ export default class ShareSubscriptionNotificationsTask extends BaseTask { }); expect(res.status).toEqual(200); - expect(res.json()).resolves.toMatchObject({ + await expect(res.json()).resolves.toMatchObject({ data: { data: { content: [ diff --git a/server/routes/api/shares/shares.ts b/server/routes/api/shares/shares.ts index 926532e979..dae015aadd 100644 --- a/server/routes/api/shares/shares.ts +++ b/server/routes/api/shares/shares.ts @@ -540,7 +540,7 @@ router.post( const confirmUrl = ShareSubscriptionHelper.confirmUrl(subscription); const usePublicBranding = share.team?.getPreference(TeamPreference.PublicBranding) ?? false; - new ShareSubscriptionConfirmEmail({ + await new ShareSubscriptionConfirmEmail({ to: email, documentTitle: document?.titleWithDefault ?? "", confirmUrl, diff --git a/shared/editor/nodes/Image.tsx b/shared/editor/nodes/Image.tsx index bb420a08b4..6a0a4e2a0d 100644 --- a/shared/editor/nodes/Image.tsx +++ b/shared/editor/nodes/Image.tsx @@ -85,7 +85,7 @@ export const downloadImageNode = async ( document.body.removeChild(link); } catch { if (cache !== "reload") { - downloadImageNode(node, "reload"); + await downloadImageNode(node, "reload"); } else { window.open(sanitizeUrl(node.attrs.src), "_blank"); }