From 50d5cdec28f8134d3aa82accbff5d4a577013831 Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Wed, 17 Jan 2024 22:06:17 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20linter=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/expo/src/app/index.tsx | 10 +++++----- .../src/app/_components/auth-showcase.tsx | 4 ++-- apps/nextjs/src/app/api/trpc/[trpc]/route.ts | 1 + apps/nextjs/src/app/page.tsx | 2 +- apps/nextjs/src/trpc/react.tsx | 2 +- packages/api/src/trpc.ts | 1 + packages/ui/src/dropdown-menu.tsx | 20 +++++++++---------- packages/ui/src/form.tsx | 16 +++++++-------- packages/ui/src/input.tsx | 2 +- packages/ui/src/label.tsx | 2 +- packages/ui/src/theme.tsx | 2 +- packages/ui/src/toast.tsx | 2 +- 12 files changed, 33 insertions(+), 31 deletions(-) diff --git a/apps/expo/src/app/index.tsx b/apps/expo/src/app/index.tsx index f53e766..adf7151 100644 --- a/apps/expo/src/app/index.tsx +++ b/apps/expo/src/app/index.tsx @@ -54,10 +54,10 @@ function CreatePost() { {error?.data?.zodError?.fieldErrors.title && ( @@ -66,10 +66,10 @@ function CreatePost() { )} {error?.data?.zodError?.fieldErrors.content && ( @@ -115,9 +115,9 @@ export default function Index() { @@ -28,11 +28,11 @@ export async function AuthShowcase() {
diff --git a/apps/nextjs/src/app/api/trpc/[trpc]/route.ts b/apps/nextjs/src/app/api/trpc/[trpc]/route.ts index c9a4269..ca064f2 100644 --- a/apps/nextjs/src/app/api/trpc/[trpc]/route.ts +++ b/apps/nextjs/src/app/api/trpc/[trpc]/route.ts @@ -35,6 +35,7 @@ const handler = auth(async (req) => { headers: req.headers, }), onError({ error, path }) { + // eslint-disable-next-line no-console console.error(`>>> tRPC Error on '${path}'`, error); }, }); diff --git a/apps/nextjs/src/app/page.tsx b/apps/nextjs/src/app/page.tsx index 6f030fc..5c61c1a 100644 --- a/apps/nextjs/src/app/page.tsx +++ b/apps/nextjs/src/app/page.tsx @@ -10,7 +10,7 @@ import { export const runtime = "edge"; -export default async function HomePage() { +export default function HomePage() { // You can await this here if you don't want to show Suspense fallback below const posts = api.post.all(); diff --git a/apps/nextjs/src/trpc/react.tsx b/apps/nextjs/src/trpc/react.tsx index 504ec4d..e782e7c 100644 --- a/apps/nextjs/src/trpc/react.tsx +++ b/apps/nextjs/src/trpc/react.tsx @@ -24,7 +24,7 @@ export function TRPCReactProvider(props: { children: React.ReactNode }) { }), unstable_httpBatchStreamLink({ url: getBaseUrl() + "/api/trpc", - async headers() { + headers() { const headers = new Headers(); headers.set("x-trpc-source", "nextjs-react"); return headers; diff --git a/packages/api/src/trpc.ts b/packages/api/src/trpc.ts index e5898ab..926d4c3 100644 --- a/packages/api/src/trpc.ts +++ b/packages/api/src/trpc.ts @@ -33,6 +33,7 @@ export const createTRPCContext = async (opts: { const session = opts.session ?? (await auth()); const source = opts.headers.get("x-trpc-source") ?? "unknown"; + // eslint-disable-next-line no-console console.log(">>> tRPC Request from", source, "by", session?.user); return { diff --git a/packages/ui/src/dropdown-menu.tsx b/packages/ui/src/dropdown-menu.tsx index 5ea9f27..df25851 100644 --- a/packages/ui/src/dropdown-menu.tsx +++ b/packages/ui/src/dropdown-menu.tsx @@ -24,12 +24,12 @@ const DropdownMenuSubTrigger = React.forwardRef< } >(({ className, inset, children, ...props }, ref) => ( {children} @@ -44,11 +44,11 @@ const DropdownMenuSubContent = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); @@ -61,13 +61,13 @@ const DropdownMenuContent = React.forwardRef< >(({ className, sideOffset = 4, ...props }, ref) => ( @@ -81,12 +81,12 @@ const DropdownMenuItem = React.forwardRef< } >(({ className, inset, ...props }, ref) => ( )); @@ -97,12 +97,12 @@ const DropdownMenuCheckboxItem = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, children, checked, ...props }, ref) => ( @@ -121,11 +121,11 @@ const DropdownMenuRadioItem = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( @@ -145,12 +145,12 @@ const DropdownMenuLabel = React.forwardRef< } >(({ className, inset, ...props }, ref) => ( )); @@ -161,8 +161,8 @@ const DropdownMenuSeparator = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); diff --git a/packages/ui/src/form.tsx b/packages/ui/src/form.tsx index 30de18d..b960294 100644 --- a/packages/ui/src/form.tsx +++ b/packages/ui/src/form.tsx @@ -99,7 +99,7 @@ const FormItem = React.forwardRef< return ( -
+
); }); @@ -113,9 +113,9 @@ const FormLabel = React.forwardRef< return (