From 4299449bdcdf9a42a4d571f8e677865fda8f326e Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 03:26:38 +0000 Subject: [PATCH] Upgrade Biome to v2.2.0 and implement React recommended rules --- .../components/__tests__/add-todo.test.tsx | 10 +++--- apps/todo-app/app/components/add-todo.tsx | 8 ++--- apps/todo-app/app/components/todo-item.tsx | 12 +++---- .../app/lib/__tests__/todo-context.test.tsx | 16 ++++++--- apps/todo-app/app/lib/todo-context.tsx | 2 +- apps/todo-app/app/root.tsx | 3 +- apps/todo-app/app/routes/create-todo.tsx | 10 +++--- apps/todo-app/app/routes/home.tsx | 10 +++--- apps/todo-app/test/setup.ts | 3 +- apps/todo-app/vite-env.d.ts | 1 - apps/todo-app/vitest.config.ts | 2 +- biome.json | 35 ++++++++++++------- bun.lock | 24 ++++++------- package.json | 2 +- packages/ui/package.json | 2 +- packages/ui/src/components/ui/button.test.tsx | 2 +- packages/ui/src/components/ui/button.tsx | 4 +-- packages/ui/src/components/ui/card.tsx | 2 +- packages/ui/src/components/ui/checkbox.tsx | 4 +-- packages/ui/src/components/ui/input.tsx | 2 +- packages/ui/src/index.ts | 6 ++-- packages/ui/src/test/setup.ts | 1 - packages/ui/vitest.config.ts | 5 ++- packages/utils/package.json | 3 +- packages/utils/src/cn.test.ts | 2 +- packages/utils/src/types.test.ts | 26 ++++++++++---- 26 files changed, 109 insertions(+), 88 deletions(-) diff --git a/apps/todo-app/app/components/__tests__/add-todo.test.tsx b/apps/todo-app/app/components/__tests__/add-todo.test.tsx index cd1925b..7a4bafa 100644 --- a/apps/todo-app/app/components/__tests__/add-todo.test.tsx +++ b/apps/todo-app/app/components/__tests__/add-todo.test.tsx @@ -1,15 +1,13 @@ -import { render, screen, fireEvent } from '@testing-library/react'; -import { describe, it, expect, vi } from 'vitest'; -import { AddTodo } from '../add-todo'; +import { fireEvent, render, screen } from '@testing-library/react'; import { createMemoryRouter, RouterProvider } from 'react-router-dom'; +import { describe, expect, it, vi } from 'vitest'; +import { AddTodo } from '../add-todo'; // Hoist regex to top-level to satisfy performance rule const addRegex = /add/i; function renderWithRouter(ui: React.ReactElement) { - const router = createMemoryRouter([ - { path: '/', element: ui } - ], { initialEntries: ['/'] }); + const router = createMemoryRouter([{ path: '/', element: ui }], { initialEntries: ['/'] }); return render(); } diff --git a/apps/todo-app/app/components/add-todo.tsx b/apps/todo-app/app/components/add-todo.tsx index e5e964a..6eb7152 100644 --- a/apps/todo-app/app/components/add-todo.tsx +++ b/apps/todo-app/app/components/add-todo.tsx @@ -1,9 +1,9 @@ -import { z } from 'zod'; import { zodResolver } from '@hookform/resolvers/zod'; -import { RemixFormProvider, useRemixForm } from 'remix-hook-form'; -import { Plus } from 'lucide-react'; -import { TextField, FormError } from '@lambdacurry/forms'; +import { FormError, TextField } from '@lambdacurry/forms'; import { Button } from '@lambdacurry/forms/ui'; +import { Plus } from 'lucide-react'; +import { RemixFormProvider, useRemixForm } from 'remix-hook-form'; +import { z } from 'zod'; const addTodoSchema = z.object({ text: z.string().min(1, 'Todo text is required').trim() diff --git a/apps/todo-app/app/components/todo-item.tsx b/apps/todo-app/app/components/todo-item.tsx index f6d62a0..121d9a3 100644 --- a/apps/todo-app/app/components/todo-item.tsx +++ b/apps/todo-app/app/components/todo-item.tsx @@ -1,13 +1,13 @@ -import { useState } from 'react'; import { zodResolver } from '@hookform/resolvers/zod'; -import { RemixFormProvider, useRemixForm } from 'remix-hook-form'; -import { z } from 'zod'; -import { Trash2, Edit2, Check, X } from 'lucide-react'; -import { TextField, FormError } from '@lambdacurry/forms'; +import { FormError, TextField } from '@lambdacurry/forms'; import { Button } from '@lambdacurry/forms/ui'; import { Checkbox } from '@todo-starter/ui'; -import { cn } from '@todo-starter/utils'; import type { Todo } from '@todo-starter/utils'; +import { cn } from '@todo-starter/utils'; +import { Check, Edit2, Trash2, X } from 'lucide-react'; +import { useState } from 'react'; +import { RemixFormProvider, useRemixForm } from 'remix-hook-form'; +import { z } from 'zod'; const editTodoSchema = z.object({ text: z.string().min(1, 'Todo text is required').trim() diff --git a/apps/todo-app/app/lib/__tests__/todo-context.test.tsx b/apps/todo-app/app/lib/__tests__/todo-context.test.tsx index 2801a65..deaa7f1 100644 --- a/apps/todo-app/app/lib/__tests__/todo-context.test.tsx +++ b/apps/todo-app/app/lib/__tests__/todo-context.test.tsx @@ -1,7 +1,7 @@ -import { describe, it, expect } from 'vitest'; -import { render, screen, act } from '@testing-library/react'; -import { TodoProvider, useTodoStore, getFilteredTodos } from '../todo-context'; +import { act, render, screen } from '@testing-library/react'; import type { Todo } from '@todo-starter/utils'; +import { describe, expect, it } from 'vitest'; +import { getFilteredTodos, TodoProvider, useTodoStore } from '../todo-context'; // Mock crypto.randomUUID for consistent testing Object.defineProperty(global, 'crypto', { @@ -27,7 +27,11 @@ function TestComponent() { -