From c5a35c1b3c49f4afc475bdf75b6bdfbd4b697a29 Mon Sep 17 00:00:00 2001 From: Kenton Duprey Date: Sat, 11 May 2024 23:03:23 -0400 Subject: [PATCH] Updating linting errors --- src/app/layout.tsx | 2 +- src/app/page.tsx | 4 ++-- src/app/qr/page.tsx | 4 ++-- src/components/Icon.tsx | 7 ------- src/components/ProjectCard.tsx | 6 +++--- src/components/Sections/About.tsx | 2 +- src/components/Sections/Contact.tsx | 4 ++-- src/components/Skill.tsx | 1 - src/components/SvgIcons/SvgIcon.tsx | 7 ------- src/libs/prisma.ts | 2 +- src/libs/stripe.ts | 6 +++++- 11 files changed, 17 insertions(+), 28 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 2f0eed34..9ce309fb 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -16,7 +16,7 @@ const inter = Inter({ const rootLayout = ({ children }: PropsWithChildren) => { return ( - + {children} ); diff --git a/src/app/page.tsx b/src/app/page.tsx index b7febfe9..ec8ee49b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -51,7 +51,7 @@ const Home: NextPage = async () => { } return ( -
+
@@ -82,7 +82,7 @@ const getContent = async (): Promise<{ projects: Project[]; skills: SkillIcon[]; }; - }>(`${process.env.GRAPH_CMS_API}`, { + }>(process.env.GRAPH_CMS_API ?? "", { params: { query: QUERY, }, diff --git a/src/app/qr/page.tsx b/src/app/qr/page.tsx index ca3fb60e..a5301537 100644 --- a/src/app/qr/page.tsx +++ b/src/app/qr/page.tsx @@ -5,11 +5,11 @@ import { SvgIcon } from "@/components"; const page = () => { return ( -
+
{ const library = iconName.icon.substring(0, 2).toLowerCase(); switch (library) { case "fa": - // const a = React.createElement(FontAwesome[iconName.icon]); - return (
{createElement( @@ -23,8 +21,6 @@ export const Icon = ({ iconName, size, color }: IconProps) => { )}
); - - break; case "si": return (
@@ -33,7 +29,6 @@ export const Icon = ({ iconName, size, color }: IconProps) => { )}
); - break; case "gr": return (
@@ -42,7 +37,6 @@ export const Icon = ({ iconName, size, color }: IconProps) => { )}
); - break; default: return (
@@ -51,6 +45,5 @@ export const Icon = ({ iconName, size, color }: IconProps) => { )}
); - break; } }; diff --git a/src/components/ProjectCard.tsx b/src/components/ProjectCard.tsx index 04c5dfee..c928d83b 100644 --- a/src/components/ProjectCard.tsx +++ b/src/components/ProjectCard.tsx @@ -11,7 +11,7 @@ export const ProjectCard = ({ projectSkills, }: Project) => { return ( -
+
{title}
-

+

{title}

-

+

{description}

diff --git a/src/components/Sections/About.tsx b/src/components/Sections/About.tsx index 2b1df533..89be51e8 100644 --- a/src/components/Sections/About.tsx +++ b/src/components/Sections/About.tsx @@ -9,7 +9,7 @@ export const About = ({ biographyBlurb, bioPic }: Bio) => { >

About

-
+
Kenton Duprey { setSuccess(false); }, 2000); }) - .catch((err) => { + .catch((err: unknown) => { console.error(err); }); }; @@ -127,7 +127,7 @@ export const Contact = () => { {loading ? "Sending..." : "Send"} diff --git a/src/components/Skill.tsx b/src/components/Skill.tsx index 74f98ef9..172b06b7 100644 --- a/src/components/Skill.tsx +++ b/src/components/Skill.tsx @@ -5,7 +5,6 @@ interface SkillProps { project: boolean; title: string; iconName: IconName; - children?: React.ReactNode; } export const Skill = ({ project, title, iconName }: SkillProps) => { diff --git a/src/components/SvgIcons/SvgIcon.tsx b/src/components/SvgIcons/SvgIcon.tsx index a5e54f26..71c02241 100644 --- a/src/components/SvgIcons/SvgIcon.tsx +++ b/src/components/SvgIcons/SvgIcon.tsx @@ -17,7 +17,6 @@ export const SvgIcon = ({ iconName }: SvgIconProps) => { ); - break; case "email": return ( { /> ); - break; case "work": return ( { /> ); - break; case "website": return ( { /> ); - break; - case "addContact": return ( { ); - break; - default: break; } diff --git a/src/libs/prisma.ts b/src/libs/prisma.ts index 312f04ea..15e965dd 100644 --- a/src/libs/prisma.ts +++ b/src/libs/prisma.ts @@ -27,7 +27,7 @@ let prisma: PrismaClient; if (typeof window === "undefined") { if (process.env.VERCEL_ENV === "production") { prisma = - global.prisma || new PrismaClient(dev ? { ...prismaConfig } : undefined); + global.prisma ?? new PrismaClient(dev ? { ...prismaConfig } : undefined); } else { if (!global.prisma) { global.prisma = new PrismaClient(dev ? { ...prismaConfig } : undefined); diff --git a/src/libs/stripe.ts b/src/libs/stripe.ts index e9a812cc..bd5ff363 100644 --- a/src/libs/stripe.ts +++ b/src/libs/stripe.ts @@ -2,7 +2,11 @@ import Stripe from "stripe"; import { z } from "zod"; export const stripe = new Stripe( - z.string().parse(process.env.STRIPE_SECRET_KEY), + z + .string({ + required_error: "STRIPE_SECRET_KEY is required", + }) + .parse(process.env.STRIPE_SECRET_KEY), { apiVersion: "2024-04-10", typescript: true,