From 188408e769cebb5e8584a2506859fbff19f4e7df Mon Sep 17 00:00:00 2001 From: Lucas Silbernagel Date: Sat, 9 Nov 2024 17:04:34 -0500 Subject: [PATCH] ran eslint and added github workflows --- .github/workflows/eslint.yml | 25 ++++++++++++++ .github/workflows/unit-tests.yml | 25 ++++++++++++++ app/components/ui/alert-dialog.tsx | 52 ++++++++++++++++++------------ 3 files changed, 82 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/eslint.yml create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 0000000..0387af7 --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,25 @@ +name: ESLint Checks + +on: + pull_request: + branches: + - main + +jobs: + eslint: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Install Dependencies + run: npm install -g pnpm && pnpm install + + - name: Run ESLint + run: pnpm run lint diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..ed6673c --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,25 @@ +name: Unit Tests + +on: + pull_request: + branches: + - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Install Dependencies + run: npm install -g pnpm && pnpm install + + - name: Run Unit Tests + run: pnpm run test-unit diff --git a/app/components/ui/alert-dialog.tsx b/app/components/ui/alert-dialog.tsx index 35bca09..46a089e 100644 --- a/app/components/ui/alert-dialog.tsx +++ b/app/components/ui/alert-dialog.tsx @@ -1,8 +1,8 @@ -import * as React from "react" -import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" +import * as React from 'react' +import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog' -import { cn } from "~/lib/utils" -import { buttonVariants } from "~/components/ui/button" +import { cn } from '~/lib/utils' +import { buttonVariants } from '~/components/ui/button' const AlertDialog = AlertDialogPrimitive.Root @@ -12,11 +12,13 @@ const AlertDialogPortal = AlertDialogPrimitive.Portal const AlertDialogOverlay = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + className?: string + } >(({ className, ...props }, ref) => ( , - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + className?: string + } >(({ className, ...props }, ref) => ( ) => (
) -AlertDialogHeader.displayName = "AlertDialogHeader" +AlertDialogHeader.displayName = 'AlertDialogHeader' const AlertDialogFooter = ({ className, @@ -63,21 +67,23 @@ const AlertDialogFooter = ({ }: React.HTMLAttributes) => (
) -AlertDialogFooter.displayName = "AlertDialogFooter" +AlertDialogFooter.displayName = 'AlertDialogFooter' const AlertDialogTitle = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + className?: string + } >(({ className, ...props }, ref) => ( )) @@ -85,11 +91,13 @@ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName const AlertDialogDescription = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + className?: string + } >(({ className, ...props }, ref) => ( )) @@ -98,7 +106,9 @@ AlertDialogDescription.displayName = const AlertDialogAction = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + className?: string + } >(({ className, ...props }, ref) => ( , - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + className?: string + } >(({ className, ...props }, ref) => (