From 4d9678a0ea5e14b5096f166ede4dff6152d68355 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Wed, 21 May 2025 16:54:25 +0530 Subject: [PATCH 1/2] Dental v1 done --- apps/Backend/src/routes/appointements.ts | 2 +- apps/Backend/src/routes/auth.ts | 2 +- apps/Backend/src/routes/patients.ts | 2 +- apps/Backend/src/routes/staffs.ts | 2 +- apps/Backend/src/routes/users.ts | 2 +- apps/Backend/src/storage/index.ts | 2 +- apps/Frontend/src/App.tsx | 32 +++++++++++-------- .../appointments/add-appointment-modal.tsx | 3 +- .../appointments/appointment-form.tsx | 2 +- .../appointments/appointment-table.tsx | 3 +- .../src/components/claims/claim-form.tsx | 3 +- .../src/components/claims/claim-modal.tsx | 3 +- .../components/patients/add-patient-modal.tsx | 2 +- .../src/components/patients/patient-form.tsx | 2 +- .../src/components/patients/patient-table.tsx | 3 +- .../src/components/staffs/staff-form.tsx | 2 +- .../src/components/staffs/staff-table.tsx | 2 +- .../src/components/ui/LoadingScreen.tsx | 31 ++++++++++++++++++ apps/Frontend/src/hooks/use-auth.tsx | 3 +- apps/Frontend/src/pages/appointments-page.tsx | 2 +- apps/Frontend/src/pages/auth-page.tsx | 3 +- apps/Frontend/src/pages/dashboard.tsx | 7 ++-- apps/Frontend/src/pages/patients-page.tsx | 3 +- apps/Frontend/src/pages/settings-page.tsx | 2 +- packages/db/package.json | 3 +- packages/db/usedSchemas/index.ts | 5 +++ 26 files changed, 81 insertions(+), 47 deletions(-) create mode 100644 apps/Frontend/src/components/ui/LoadingScreen.tsx create mode 100644 packages/db/usedSchemas/index.ts diff --git a/apps/Backend/src/routes/appointements.ts b/apps/Backend/src/routes/appointements.ts index 40ad560..7c22a40 100644 --- a/apps/Backend/src/routes/appointements.ts +++ b/apps/Backend/src/routes/appointements.ts @@ -4,7 +4,7 @@ import { storage } from "../storage"; import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema, -} from "@repo/db/shared/schemas"; +} from "@repo/db/usedSchemas"; import { z } from "zod"; const router = Router(); diff --git a/apps/Backend/src/routes/auth.ts b/apps/Backend/src/routes/auth.ts index 0d37b96..3b628f0 100644 --- a/apps/Backend/src/routes/auth.ts +++ b/apps/Backend/src/routes/auth.ts @@ -2,7 +2,7 @@ import express, { Request, Response, NextFunction } from 'express'; import jwt from 'jsonwebtoken'; import bcrypt from 'bcrypt'; import { storage } from '../storage'; -import { UserUncheckedCreateInputObjectSchema } from '@repo/db/shared/schemas'; +import { UserUncheckedCreateInputObjectSchema } from '@repo/db/usedSchemas'; import { z } from 'zod'; type SelectUser = z.infer; diff --git a/apps/Backend/src/routes/patients.ts b/apps/Backend/src/routes/patients.ts index 9d67354..e8b7c65 100644 --- a/apps/Backend/src/routes/patients.ts +++ b/apps/Backend/src/routes/patients.ts @@ -4,7 +4,7 @@ import { storage } from "../storage"; import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema, -} from "@repo/db/shared/schemas"; +} from "@repo/db/usedSchemas"; import { z } from "zod"; const router = Router(); diff --git a/apps/Backend/src/routes/staffs.ts b/apps/Backend/src/routes/staffs.ts index da064f3..890674d 100644 --- a/apps/Backend/src/routes/staffs.ts +++ b/apps/Backend/src/routes/staffs.ts @@ -2,7 +2,7 @@ import { Router } from "express"; import type { Request, Response } from "express"; import { storage } from "../storage"; import { z } from "zod"; -import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; type Staff = z.infer; diff --git a/apps/Backend/src/routes/users.ts b/apps/Backend/src/routes/users.ts index e896730..fde23c4 100644 --- a/apps/Backend/src/routes/users.ts +++ b/apps/Backend/src/routes/users.ts @@ -2,7 +2,7 @@ import { Router } from "express"; import type { Request, Response } from "express"; import { storage } from "../storage"; import { z } from "zod"; -import { UserUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { UserUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; const router = Router(); diff --git a/apps/Backend/src/storage/index.ts b/apps/Backend/src/storage/index.ts index 93620f8..6dad81b 100644 --- a/apps/Backend/src/storage/index.ts +++ b/apps/Backend/src/storage/index.ts @@ -4,7 +4,7 @@ import { PatientUncheckedCreateInputObjectSchema, UserUncheckedCreateInputObjectSchema, StaffUncheckedCreateInputObjectSchema, -} from "@repo/db/shared/schemas"; +} from "@repo/db/usedSchemas"; import { z } from "zod"; //creating types out of schema auto generated. diff --git a/apps/Frontend/src/App.tsx b/apps/Frontend/src/App.tsx index 882527d..73ae74f 100644 --- a/apps/Frontend/src/App.tsx +++ b/apps/Frontend/src/App.tsx @@ -1,37 +1,43 @@ import { Switch, Route } from "wouter"; +import React, { Suspense, lazy } from "react"; import { queryClient } from "./lib/queryClient"; import { QueryClientProvider } from "@tanstack/react-query"; import { Toaster } from "./components/ui/toaster"; import { TooltipProvider } from "./components/ui/tooltip"; -import NotFound from "./pages/not-found"; -import Dashboard from "./pages/dashboard"; -import AuthPage from "./pages/auth-page"; -import AppointmentsPage from "./pages/appointments-page"; -import PatientsPage from "./pages/patients-page"; import { ProtectedRoute } from "./lib/protected-route"; import { AuthProvider } from "./hooks/use-auth"; -import SettingsPage from "./pages/settings-page"; + +import Dashboard from "./pages/dashboard"; +import LoadingScreen from "./components/ui/LoadingScreen"; +const AuthPage = lazy(() => import("./pages/auth-page")); +const AppointmentsPage = lazy(() => import("./pages/appointments-page")); +const PatientsPage = lazy(() => import("./pages/patients-page")); +const SettingsPage = lazy(() => import("./pages/settings-page")); +const NotFound = lazy(() => import("./pages/not-found")); function Router() { return ( - - - - - - + } /> + } /> + } /> + } /> + } /> + } /> ); } + function App() { return ( - + }> + + diff --git a/apps/Frontend/src/components/appointments/add-appointment-modal.tsx b/apps/Frontend/src/components/appointments/add-appointment-modal.tsx index 4ff1a33..871c07e 100644 --- a/apps/Frontend/src/components/appointments/add-appointment-modal.tsx +++ b/apps/Frontend/src/components/appointments/add-appointment-modal.tsx @@ -1,8 +1,7 @@ import { useState } from "react"; import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"; import { AppointmentForm } from "./appointment-form"; -// import { Appointment, InsertAppointment, UpdateAppointment, Patient } from "@repo/db/shared/schemas"; -import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import {z} from "zod"; type Appointment = z.infer; diff --git a/apps/Frontend/src/components/appointments/appointment-form.tsx b/apps/Frontend/src/components/appointments/appointment-form.tsx index b954045..67e43e9 100644 --- a/apps/Frontend/src/components/appointments/appointment-form.tsx +++ b/apps/Frontend/src/components/appointments/appointment-form.tsx @@ -36,7 +36,7 @@ import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema, StaffUncheckedCreateInputObjectSchema, -} from "@repo/db/shared/schemas"; +} from "@repo/db/usedSchemas"; import { z } from "zod"; type Appointment = z.infer; diff --git a/apps/Frontend/src/components/appointments/appointment-table.tsx b/apps/Frontend/src/components/appointments/appointment-table.tsx index 07c891c..438007e 100644 --- a/apps/Frontend/src/components/appointments/appointment-table.tsx +++ b/apps/Frontend/src/components/appointments/appointment-table.tsx @@ -25,11 +25,10 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; -// import { Appointment, Patient } from "@repo/db/shared/schemas"; import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema, -} from "@repo/db/shared/schemas"; +} from "@repo/db/usedSchemas"; import { z } from "zod"; type Appointment = z.infer; diff --git a/apps/Frontend/src/components/claims/claim-form.tsx b/apps/Frontend/src/components/claims/claim-form.tsx index 7c7e56b..5407d96 100644 --- a/apps/Frontend/src/components/claims/claim-form.tsx +++ b/apps/Frontend/src/components/claims/claim-form.tsx @@ -15,8 +15,7 @@ import { X, Calendar as CalendarIcon } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; import { Calendar } from "@/components/ui/calendar"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; -// import { Patient } from "@repo/db/shared/schemas"; -import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import {z} from "zod"; const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject).omit({ diff --git a/apps/Frontend/src/components/claims/claim-modal.tsx b/apps/Frontend/src/components/claims/claim-modal.tsx index b2057ac..ae69646 100644 --- a/apps/Frontend/src/components/claims/claim-modal.tsx +++ b/apps/Frontend/src/components/claims/claim-modal.tsx @@ -1,7 +1,6 @@ import { useState, useEffect } from "react"; import { ClaimForm } from "./claim-form"; -// import { Patient } from "@repo/db/shared/schemas"; -import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import {z} from "zod"; const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject).omit({ diff --git a/apps/Frontend/src/components/patients/add-patient-modal.tsx b/apps/Frontend/src/components/patients/add-patient-modal.tsx index 5c0f355..26f16f7 100644 --- a/apps/Frontend/src/components/patients/add-patient-modal.tsx +++ b/apps/Frontend/src/components/patients/add-patient-modal.tsx @@ -18,7 +18,7 @@ import { PatientForm, PatientFormRef } from "./patient-form"; import { useToast } from "@/hooks/use-toast"; import { X, Calendar } from "lucide-react"; import { useLocation } from "wouter"; -import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { z } from "zod"; const PatientSchema = ( diff --git a/apps/Frontend/src/components/patients/patient-form.tsx b/apps/Frontend/src/components/patients/patient-form.tsx index e03fb41..375c904 100644 --- a/apps/Frontend/src/components/patients/patient-form.tsx +++ b/apps/Frontend/src/components/patients/patient-form.tsx @@ -1,7 +1,7 @@ import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; -import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { useAuth } from "@/hooks/use-auth"; import { Form, diff --git a/apps/Frontend/src/components/patients/patient-table.tsx b/apps/Frontend/src/components/patients/patient-table.tsx index 29eaf5f..7be78fe 100644 --- a/apps/Frontend/src/components/patients/patient-table.tsx +++ b/apps/Frontend/src/components/patients/patient-table.tsx @@ -25,8 +25,7 @@ import { PaginationNext, PaginationPrevious, } from "@/components/ui/pagination"; -// import { Patient } from "@repo/db/shared/schemas"; -import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import {z} from "zod"; const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject).omit({ diff --git a/apps/Frontend/src/components/staffs/staff-form.tsx b/apps/Frontend/src/components/staffs/staff-form.tsx index 4bea0f9..9f3d204 100644 --- a/apps/Frontend/src/components/staffs/staff-form.tsx +++ b/apps/Frontend/src/components/staffs/staff-form.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from "react"; -import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { z } from "zod"; type Staff = z.infer; diff --git a/apps/Frontend/src/components/staffs/staff-table.tsx b/apps/Frontend/src/components/staffs/staff-table.tsx index e3e7ae8..a9f29d2 100644 --- a/apps/Frontend/src/components/staffs/staff-table.tsx +++ b/apps/Frontend/src/components/staffs/staff-table.tsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; import { z } from "zod"; -import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { Button } from "../ui/button"; import { Delete, Edit } from "lucide-react"; diff --git a/apps/Frontend/src/components/ui/LoadingScreen.tsx b/apps/Frontend/src/components/ui/LoadingScreen.tsx new file mode 100644 index 0000000..35be296 --- /dev/null +++ b/apps/Frontend/src/components/ui/LoadingScreen.tsx @@ -0,0 +1,31 @@ +import React from "react"; + +export default function LoadingScreen() { + return ( +
+
+ + + + +

Loading, please wait...

+
+
+ ); +} diff --git a/apps/Frontend/src/hooks/use-auth.tsx b/apps/Frontend/src/hooks/use-auth.tsx index 936e28f..48a8a4c 100644 --- a/apps/Frontend/src/hooks/use-auth.tsx +++ b/apps/Frontend/src/hooks/use-auth.tsx @@ -4,8 +4,7 @@ import { useMutation, UseMutationResult, } from "@tanstack/react-query"; -// import { insertUserSchema, User as SelectUser, InsertUser } from "@repo/db/shared/schemas"; -import { UserUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { UserUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { z } from "zod"; import { getQueryFn, apiRequest, queryClient } from "../lib/queryClient"; import { useToast } from "@/hooks/use-toast"; diff --git a/apps/Frontend/src/pages/appointments-page.tsx b/apps/Frontend/src/pages/appointments-page.tsx index 73d7a5e..9aa6ac0 100644 --- a/apps/Frontend/src/pages/appointments-page.tsx +++ b/apps/Frontend/src/pages/appointments-page.tsx @@ -22,7 +22,7 @@ import { Calendar } from "@/components/ui/calendar"; import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema, -} from "@repo/db/shared/schemas"; +} from "@repo/db/usedSchemas"; import { apiRequest, queryClient } from "@/lib/queryClient"; import { useAuth } from "@/hooks/use-auth"; import { diff --git a/apps/Frontend/src/pages/auth-page.tsx b/apps/Frontend/src/pages/auth-page.tsx index bfb831e..13fdb3e 100644 --- a/apps/Frontend/src/pages/auth-page.tsx +++ b/apps/Frontend/src/pages/auth-page.tsx @@ -1,8 +1,7 @@ import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; -import { UserUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; -// import { insertUserSchema } from "@repo/db/shared/schemas"; +import { UserUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { useState } from "react"; import { useAuth } from "@/hooks/use-auth"; import { Redirect } from "wouter"; diff --git a/apps/Frontend/src/pages/dashboard.tsx b/apps/Frontend/src/pages/dashboard.tsx index eecf479..d251aa4 100644 --- a/apps/Frontend/src/pages/dashboard.tsx +++ b/apps/Frontend/src/pages/dashboard.tsx @@ -12,10 +12,9 @@ import { Button } from "@/components/ui/button"; import { useToast } from "@/hooks/use-toast"; import { useAuth } from "@/hooks/use-auth"; import { apiRequest, queryClient } from "@/lib/queryClient"; -import { - AppointmentUncheckedCreateInputObjectSchema, - PatientUncheckedCreateInputObjectSchema, -} from "@repo/db/shared/schemas"; +import { AppointmentUncheckedCreateInputObjectSchema } from '@repo/db/usedSchemas'; +import { PatientUncheckedCreateInputObjectSchema } from '@repo/db/usedSchemas'; + import { Users, Calendar, diff --git a/apps/Frontend/src/pages/patients-page.tsx b/apps/Frontend/src/pages/patients-page.tsx index a2aab82..82141f8 100644 --- a/apps/Frontend/src/pages/patients-page.tsx +++ b/apps/Frontend/src/pages/patients-page.tsx @@ -19,8 +19,7 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; -// import { Patient, InsertPatient, UpdatePatient } from "@repo/db/shared/schemas"; +import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { apiRequest, queryClient } from "@/lib/queryClient"; import { useAuth } from "@/hooks/use-auth"; import { z } from "zod"; diff --git a/apps/Frontend/src/pages/settings-page.tsx b/apps/Frontend/src/pages/settings-page.tsx index 7034fff..080a80f 100644 --- a/apps/Frontend/src/pages/settings-page.tsx +++ b/apps/Frontend/src/pages/settings-page.tsx @@ -5,7 +5,7 @@ import { Sidebar } from "@/components/layout/sidebar"; import { StaffTable } from "@/components/staffs/staff-table"; import { useToast } from "@/hooks/use-toast"; import { Card, CardContent } from "@/components/ui/card"; -import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas"; +import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { z } from "zod"; import { apiRequest, queryClient } from "@/lib/queryClient"; import { StaffForm } from "@/components/staffs/staff-form"; diff --git a/packages/db/package.json b/packages/db/package.json index c27a359..b79c828 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -12,7 +12,8 @@ "type": "commonjs", "exports": { "./client": "./src/index.ts", - "./shared/schemas" : "./shared/schemas/index.ts" + "./shared/schemas" : "./shared/schemas/index.ts", + "./usedSchemas" : "./usedSchemas/index.ts" }, "dependencies": { "@prisma/client": "^6.7.0", diff --git a/packages/db/usedSchemas/index.ts b/packages/db/usedSchemas/index.ts new file mode 100644 index 0000000..d316829 --- /dev/null +++ b/packages/db/usedSchemas/index.ts @@ -0,0 +1,5 @@ +// using this, as the browser load only the required files , not whole db/shared/schemas/ files. +export * from '../shared/schemas/objects/AppointmentUncheckedCreateInput.schema'; +export * from '../shared/schemas/objects/PatientUncheckedCreateInput.schema'; +export * from '../shared/schemas/objects/UserUncheckedCreateInput.schema'; +export * from '../shared/schemas/objects/StaffUncheckedCreateInput.schema' \ No newline at end of file From b6857c581195cea6c7f675a9d82b4158f4ca9b52 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Fri, 23 May 2025 17:14:54 +0530 Subject: [PATCH 2/2] removed eslint no use --- packages/eslint-config/README.md | 3 -- packages/eslint-config/base.js | 32 ---------------- packages/eslint-config/next.js | 49 ------------------------ packages/eslint-config/package.json | 24 ------------ packages/eslint-config/react-internal.js | 39 ------------------- 5 files changed, 147 deletions(-) delete mode 100644 packages/eslint-config/README.md delete mode 100644 packages/eslint-config/base.js delete mode 100644 packages/eslint-config/next.js delete mode 100644 packages/eslint-config/package.json delete mode 100644 packages/eslint-config/react-internal.js diff --git a/packages/eslint-config/README.md b/packages/eslint-config/README.md deleted file mode 100644 index 8b42d90..0000000 --- a/packages/eslint-config/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `@turbo/eslint-config` - -Collection of internal eslint configurations. diff --git a/packages/eslint-config/base.js b/packages/eslint-config/base.js deleted file mode 100644 index 31f5f43..0000000 --- a/packages/eslint-config/base.js +++ /dev/null @@ -1,32 +0,0 @@ -import js from "@eslint/js"; -import eslintConfigPrettier from "eslint-config-prettier"; -import turboPlugin from "eslint-plugin-turbo"; -import tseslint from "typescript-eslint"; -import onlyWarn from "eslint-plugin-only-warn"; - -/** - * A shared ESLint configuration for the repository. - * - * @type {import("eslint").Linter.Config} - * */ -export const config = [ - js.configs.recommended, - eslintConfigPrettier, - ...tseslint.configs.recommended, - { - plugins: { - turbo: turboPlugin, - }, - rules: { - "turbo/no-undeclared-env-vars": "warn", - }, - }, - { - plugins: { - onlyWarn, - }, - }, - { - ignores: ["dist/**"], - }, -]; diff --git a/packages/eslint-config/next.js b/packages/eslint-config/next.js deleted file mode 100644 index 1997af7..0000000 --- a/packages/eslint-config/next.js +++ /dev/null @@ -1,49 +0,0 @@ -import js from "@eslint/js"; -import eslintConfigPrettier from "eslint-config-prettier"; -import tseslint from "typescript-eslint"; -import pluginReactHooks from "eslint-plugin-react-hooks"; -import pluginReact from "eslint-plugin-react"; -import globals from "globals"; -import pluginNext from "@next/eslint-plugin-next"; -import { config as baseConfig } from "./base.js"; - -/** - * A custom ESLint configuration for libraries that use Next.js. - * - * @type {import("eslint").Linter.Config} - * */ -export const nextJsConfig = [ - ...baseConfig, - js.configs.recommended, - eslintConfigPrettier, - ...tseslint.configs.recommended, - { - ...pluginReact.configs.flat.recommended, - languageOptions: { - ...pluginReact.configs.flat.recommended.languageOptions, - globals: { - ...globals.serviceworker, - }, - }, - }, - { - plugins: { - "@next/next": pluginNext, - }, - rules: { - ...pluginNext.configs.recommended.rules, - ...pluginNext.configs["core-web-vitals"].rules, - }, - }, - { - plugins: { - "react-hooks": pluginReactHooks, - }, - settings: { react: { version: "detect" } }, - rules: { - ...pluginReactHooks.configs.recommended.rules, - // React scope no longer necessary with new JSX transform. - "react/react-in-jsx-scope": "off", - }, - }, -]; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json deleted file mode 100644 index d4f9c5c..0000000 --- a/packages/eslint-config/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@repo/eslint-config", - "version": "0.0.0", - "type": "module", - "private": true, - "exports": { - "./base": "./base.js", - "./next-js": "./next.js", - "./react-internal": "./react-internal.js" - }, - "devDependencies": { - "@eslint/js": "^9.26.0", - "@next/eslint-plugin-next": "^15.3.0", - "eslint": "^9.26.0", - "eslint-config-prettier": "^10.1.1", - "eslint-plugin-only-warn": "^1.1.0", - "eslint-plugin-react": "^7.37.4", - "eslint-plugin-react-hooks": "^5.2.0", - "eslint-plugin-turbo": "^2.5.0", - "globals": "^16.0.0", - "typescript": "^5.8.2", - "typescript-eslint": "^8.31.0" - } -} diff --git a/packages/eslint-config/react-internal.js b/packages/eslint-config/react-internal.js deleted file mode 100644 index 0cc8b1d..0000000 --- a/packages/eslint-config/react-internal.js +++ /dev/null @@ -1,39 +0,0 @@ -import js from "@eslint/js"; -import eslintConfigPrettier from "eslint-config-prettier"; -import tseslint from "typescript-eslint"; -import pluginReactHooks from "eslint-plugin-react-hooks"; -import pluginReact from "eslint-plugin-react"; -import globals from "globals"; -import { config as baseConfig } from "./base.js"; - -/** - * A custom ESLint configuration for libraries that use React. - * - * @type {import("eslint").Linter.Config} */ -export const config = [ - ...baseConfig, - js.configs.recommended, - eslintConfigPrettier, - ...tseslint.configs.recommended, - pluginReact.configs.flat.recommended, - { - languageOptions: { - ...pluginReact.configs.flat.recommended.languageOptions, - globals: { - ...globals.serviceworker, - ...globals.browser, - }, - }, - }, - { - plugins: { - "react-hooks": pluginReactHooks, - }, - settings: { react: { version: "detect" } }, - rules: { - ...pluginReactHooks.configs.recommended.rules, - // React scope no longer necessary with new JSX transform. - "react/react-in-jsx-scope": "off", - }, - }, -];