From 0e21900e833dd40edbd06f2a99da52c6a6cf9b46 Mon Sep 17 00:00:00 2001 From: atridadl Date: Wed, 13 Dec 2023 14:52:56 -0700 Subject: [PATCH] ESLint Fixes --- app/routes/api.room.get.$roomId.tsx | 2 +- app/routes/api.room.get.all.tsx | 2 +- app/routes/api.room.presence.get.$roomId.tsx | 2 +- app/routes/api.room.set.$roomId.tsx | 2 +- app/routes/api.vote.set.$roomId.tsx | 2 +- app/routes/api.votes.get.$roomId.tsx | 2 +- app/routes/api.webhooks.clerk.tsx | 4 ++-- app/routes/dashboard.tsx | 2 +- app/routes/room.$roomId.tsx | 12 ++++++------ app/services/redis.server.ts | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/routes/api.room.get.$roomId.tsx b/app/routes/api.room.get.$roomId.tsx index 80cf03b..5f33ca2 100644 --- a/app/routes/api.room.get.$roomId.tsx +++ b/app/routes/api.room.get.$roomId.tsx @@ -1,5 +1,5 @@ import { getAuth } from "@clerk/remix/ssr.server"; -import { LoaderFunctionArgs, json } from "@remix-run/node"; +import { type LoaderFunctionArgs, json } from "@remix-run/node"; import { eq } from "drizzle-orm"; import { eventStream } from "remix-utils/sse/server"; import { db } from "~/services/db.server"; diff --git a/app/routes/api.room.get.all.tsx b/app/routes/api.room.get.all.tsx index b0bc8a9..d19abe5 100644 --- a/app/routes/api.room.get.all.tsx +++ b/app/routes/api.room.get.all.tsx @@ -1,5 +1,5 @@ import { getAuth } from "@clerk/remix/ssr.server"; -import { LoaderFunctionArgs, json } from "@remix-run/node"; +import { type LoaderFunctionArgs, json } from "@remix-run/node"; import { eq } from "drizzle-orm"; import { eventStream } from "remix-utils/sse/server"; import { db } from "~/services/db.server"; diff --git a/app/routes/api.room.presence.get.$roomId.tsx b/app/routes/api.room.presence.get.$roomId.tsx index 0c67439..4a413a5 100644 --- a/app/routes/api.room.presence.get.$roomId.tsx +++ b/app/routes/api.room.presence.get.$roomId.tsx @@ -1,5 +1,5 @@ import { getAuth } from "@clerk/remix/ssr.server"; -import { LoaderFunctionArgs, json } from "@remix-run/node"; +import { type LoaderFunctionArgs, json } from "@remix-run/node"; import { and, eq } from "drizzle-orm"; import { eventStream } from "remix-utils/sse/server"; import { db } from "~/services/db.server"; diff --git a/app/routes/api.room.set.$roomId.tsx b/app/routes/api.room.set.$roomId.tsx index 12b05fe..594e2b6 100644 --- a/app/routes/api.room.set.$roomId.tsx +++ b/app/routes/api.room.set.$roomId.tsx @@ -1,5 +1,5 @@ import { getAuth } from "@clerk/remix/ssr.server"; -import { ActionFunctionArgs, json } from "@remix-run/node"; +import { type ActionFunctionArgs, json } from "@remix-run/node"; import { createId } from "@paralleldrive/cuid2"; import { db } from "~/services/db.server"; import { emitter } from "~/services/emitter.server"; diff --git a/app/routes/api.vote.set.$roomId.tsx b/app/routes/api.vote.set.$roomId.tsx index a91d605..aa2f68d 100644 --- a/app/routes/api.vote.set.$roomId.tsx +++ b/app/routes/api.vote.set.$roomId.tsx @@ -1,5 +1,5 @@ import { getAuth } from "@clerk/remix/ssr.server"; -import { ActionFunctionArgs, json } from "@remix-run/node"; +import { type ActionFunctionArgs, json } from "@remix-run/node"; import { createId } from "@paralleldrive/cuid2"; import { db } from "~/services/db.server"; import { emitter } from "~/services/emitter.server"; diff --git a/app/routes/api.votes.get.$roomId.tsx b/app/routes/api.votes.get.$roomId.tsx index cd5c87f..fa66034 100644 --- a/app/routes/api.votes.get.$roomId.tsx +++ b/app/routes/api.votes.get.$roomId.tsx @@ -1,5 +1,5 @@ import { getAuth } from "@clerk/remix/ssr.server"; -import { LoaderFunctionArgs, json } from "@remix-run/node"; +import { type LoaderFunctionArgs, json } from "@remix-run/node"; import { eq } from "drizzle-orm"; import { eventStream } from "remix-utils/sse/server"; import { db } from "~/services/db.server"; diff --git a/app/routes/api.webhooks.clerk.tsx b/app/routes/api.webhooks.clerk.tsx index 1f4b4b1..084db5c 100644 --- a/app/routes/api.webhooks.clerk.tsx +++ b/app/routes/api.webhooks.clerk.tsx @@ -1,6 +1,6 @@ -import { ActionFunctionArgs, json } from "@remix-run/node"; +import { type ActionFunctionArgs, json } from "@remix-run/node"; import { Webhook } from "svix"; -import { WebhookEvent } from "@clerk/remix/api.server"; +import { type WebhookEvent } from "@clerk/remix/api.server"; import { onUserCreatedHandler, onUserDeletedHandler, diff --git a/app/routes/dashboard.tsx b/app/routes/dashboard.tsx index 5469e72..e3ade04 100644 --- a/app/routes/dashboard.tsx +++ b/app/routes/dashboard.tsx @@ -51,7 +51,7 @@ export default function Dashboard() { function DashboardContent() { const { user, isLoaded } = useUser(); - let roomsFromDb = useEventSource("/api/room/get/all", { event: user?.id! }); + let roomsFromDb = useEventSource("/api/room/get/all", { event: user?.id }); let roomsFromDbParsed = JSON.parse(roomsFromDb!) as RoomsResponse; diff --git a/app/routes/room.$roomId.tsx b/app/routes/room.$roomId.tsx index fcfdb23..753c0c0 100644 --- a/app/routes/room.$roomId.tsx +++ b/app/routes/room.$roomId.tsx @@ -1,5 +1,5 @@ import { getAuth } from "@clerk/remix/ssr.server"; -import { LoaderFunction, redirect } from "@remix-run/node"; +import { type LoaderFunction, redirect } from "@remix-run/node"; import { useParams } from "@remix-run/react"; import { CheckCircleIcon, @@ -17,7 +17,7 @@ import { import { useEffect, useState } from "react"; import LoadingIndicator from "~/components/LoadingIndicator"; import { useEventSource } from "remix-utils/sse/react"; -import { +import type { PresenceItem, RoomResponse, VoteResponse, @@ -223,12 +223,12 @@ function RoomContent() { ); if (visible) { - if (!!matchedVote) { + if (matchedVote) { return
{matchedVote.value}
; } else { return ; } - } else if (!!matchedVote) { + } else if (matchedVote) { return ; } else { return ; @@ -296,7 +296,7 @@ function RoomContent() {
{`${presenceItem.userFullName}'s @@ -335,7 +335,7 @@ function RoomContent() { {roomFromDb && votesFromDb && voteString( - roomFromDbParsed?.visible!, + roomFromDbParsed?.visible || false, votesFromDbParsed, presenceItem )} diff --git a/app/services/redis.server.ts b/app/services/redis.server.ts index 0b7d9b5..7625820 100644 --- a/app/services/redis.server.ts +++ b/app/services/redis.server.ts @@ -86,7 +86,7 @@ export const subscribeToChannel = async ( }; export const unsubscribeToChannel = (channel: string) => { - `Unsubscribed successfully from ${channel}!`; + console.log(`Unsubscribed successfully from ${channel}!`); Promise.resolve([sub?.unsubscribe(channel)]); };