Merge remote-tracking branch 'origin/main' into dev_replit_v2
This commit is contained in:
@@ -4,7 +4,7 @@ import { storage } from "../storage";
|
|||||||
import {
|
import {
|
||||||
AppointmentUncheckedCreateInputObjectSchema,
|
AppointmentUncheckedCreateInputObjectSchema,
|
||||||
PatientUncheckedCreateInputObjectSchema,
|
PatientUncheckedCreateInputObjectSchema,
|
||||||
} from "@repo/db/shared/schemas";
|
} from "@repo/db/usedSchemas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import express, { Request, Response, NextFunction } from 'express';
|
|||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
import bcrypt from 'bcrypt';
|
import bcrypt from 'bcrypt';
|
||||||
import { storage } from '../storage';
|
import { storage } from '../storage';
|
||||||
import { UserUncheckedCreateInputObjectSchema } from '@repo/db/shared/schemas';
|
import { UserUncheckedCreateInputObjectSchema } from '@repo/db/usedSchemas';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
type SelectUser = z.infer<typeof UserUncheckedCreateInputObjectSchema>;
|
type SelectUser = z.infer<typeof UserUncheckedCreateInputObjectSchema>;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { storage } from "../storage";
|
|||||||
import {
|
import {
|
||||||
AppointmentUncheckedCreateInputObjectSchema,
|
AppointmentUncheckedCreateInputObjectSchema,
|
||||||
PatientUncheckedCreateInputObjectSchema,
|
PatientUncheckedCreateInputObjectSchema,
|
||||||
} from "@repo/db/shared/schemas";
|
} from "@repo/db/usedSchemas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Router } from "express";
|
|||||||
import type { Request, Response } from "express";
|
import type { Request, Response } from "express";
|
||||||
import { storage } from "../storage";
|
import { storage } from "../storage";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
|
|
||||||
type Staff = z.infer<typeof StaffUncheckedCreateInputObjectSchema>;
|
type Staff = z.infer<typeof StaffUncheckedCreateInputObjectSchema>;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Router } from "express";
|
|||||||
import type { Request, Response } from "express";
|
import type { Request, Response } from "express";
|
||||||
import { storage } from "../storage";
|
import { storage } from "../storage";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { UserUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
import { UserUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
PatientUncheckedCreateInputObjectSchema,
|
PatientUncheckedCreateInputObjectSchema,
|
||||||
UserUncheckedCreateInputObjectSchema,
|
UserUncheckedCreateInputObjectSchema,
|
||||||
StaffUncheckedCreateInputObjectSchema,
|
StaffUncheckedCreateInputObjectSchema,
|
||||||
} from "@repo/db/shared/schemas";
|
} from "@repo/db/usedSchemas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
//creating types out of schema auto generated.
|
//creating types out of schema auto generated.
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ import { Toaster } from "./components/ui/toaster";
|
|||||||
import { TooltipProvider } from "./components/ui/tooltip";
|
import { TooltipProvider } from "./components/ui/tooltip";
|
||||||
import { ProtectedRoute } from "./lib/protected-route";
|
import { ProtectedRoute } from "./lib/protected-route";
|
||||||
import { AuthProvider } from "./hooks/use-auth";
|
import { AuthProvider } from "./hooks/use-auth";
|
||||||
|
|
||||||
import Dashboard from "./pages/dashboard";
|
import Dashboard from "./pages/dashboard";
|
||||||
|
import LoadingScreen from "./components/ui/LoadingScreen";
|
||||||
|
|
||||||
|
|
||||||
const AuthPage = lazy(() => import("./pages/auth-page"));
|
const AuthPage = lazy(() => import("./pages/auth-page"));
|
||||||
const AppointmentsPage = lazy(() => import("./pages/appointments-page"));
|
const AppointmentsPage = lazy(() => import("./pages/appointments-page"));
|
||||||
const PatientsPage = lazy(() => import("./pages/patients-page"));
|
const PatientsPage = lazy(() => import("./pages/patients-page"));
|
||||||
@@ -40,7 +42,7 @@ function App() {
|
|||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<Toaster />
|
<Toaster />
|
||||||
<Suspense fallback={<div>Loading...</div>}>
|
<Suspense fallback={<LoadingScreen />}>
|
||||||
<Router />
|
<Router />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||||
import { AppointmentForm } from "./appointment-form";
|
import { AppointmentForm } from "./appointment-form";
|
||||||
// import { Appointment, InsertAppointment, UpdateAppointment, Patient } from "@repo/db/shared/schemas";
|
import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
import { AppointmentUncheckedCreateInputObjectSchema, PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
|
||||||
|
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
type Appointment = z.infer<typeof AppointmentUncheckedCreateInputObjectSchema>;
|
type Appointment = z.infer<typeof AppointmentUncheckedCreateInputObjectSchema>;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import {
|
|||||||
AppointmentUncheckedCreateInputObjectSchema,
|
AppointmentUncheckedCreateInputObjectSchema,
|
||||||
PatientUncheckedCreateInputObjectSchema,
|
PatientUncheckedCreateInputObjectSchema,
|
||||||
StaffUncheckedCreateInputObjectSchema,
|
StaffUncheckedCreateInputObjectSchema,
|
||||||
} from "@repo/db/shared/schemas";
|
} from "@repo/db/usedSchemas";
|
||||||
|
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
type Appointment = z.infer<typeof AppointmentUncheckedCreateInputObjectSchema>;
|
type Appointment = z.infer<typeof AppointmentUncheckedCreateInputObjectSchema>;
|
||||||
|
|||||||
@@ -25,11 +25,10 @@ import {
|
|||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "@/components/ui/dropdown-menu";
|
} from "@/components/ui/dropdown-menu";
|
||||||
// import { Appointment, Patient } from "@repo/db/shared/schemas";
|
|
||||||
import {
|
import {
|
||||||
AppointmentUncheckedCreateInputObjectSchema,
|
AppointmentUncheckedCreateInputObjectSchema,
|
||||||
PatientUncheckedCreateInputObjectSchema,
|
PatientUncheckedCreateInputObjectSchema,
|
||||||
} from "@repo/db/shared/schemas";
|
} from "@repo/db/usedSchemas";
|
||||||
|
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
type Appointment = z.infer<typeof AppointmentUncheckedCreateInputObjectSchema>;
|
type Appointment = z.infer<typeof AppointmentUncheckedCreateInputObjectSchema>;
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ import { X, Calendar as CalendarIcon } from "lucide-react";
|
|||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
import { Calendar } from "@/components/ui/calendar";
|
import { Calendar } from "@/components/ui/calendar";
|
||||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||||
// import { Patient } from "@repo/db/shared/schemas";
|
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
|
|
||||||
const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>).omit({
|
const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>).omit({
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { ClaimForm } from "./claim-form";
|
import { ClaimForm } from "./claim-form";
|
||||||
// import { Patient } from "@repo/db/shared/schemas";
|
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
|
|
||||||
const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>).omit({
|
const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>).omit({
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { PatientForm, PatientFormRef } from "./patient-form";
|
|||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
import { X, Calendar } from "lucide-react";
|
import { X, Calendar } from "lucide-react";
|
||||||
import { useLocation } from "wouter";
|
import { useLocation } from "wouter";
|
||||||
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
const PatientSchema = (
|
const PatientSchema = (
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "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 { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ import {
|
|||||||
PaginationNext,
|
PaginationNext,
|
||||||
PaginationPrevious,
|
PaginationPrevious,
|
||||||
} from "@/components/ui/pagination";
|
} from "@/components/ui/pagination";
|
||||||
// import { Patient } from "@repo/db/shared/schemas";
|
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
|
|
||||||
const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>).omit({
|
const PatientSchema = (PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>).omit({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
type Staff = z.infer<typeof StaffUncheckedCreateInputObjectSchema>;
|
type Staff = z.infer<typeof StaffUncheckedCreateInputObjectSchema>;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import { Delete, Edit } from "lucide-react";
|
import { Delete, Edit } from "lucide-react";
|
||||||
|
|
||||||
|
|||||||
31
apps/Frontend/src/components/ui/LoadingScreen.tsx
Normal file
31
apps/Frontend/src/components/ui/LoadingScreen.tsx
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export default function LoadingScreen() {
|
||||||
|
return (
|
||||||
|
<div className="flex items-center justify-center min-h-screen bg-white text-gray-800">
|
||||||
|
<div className="flex flex-col items-center space-y-4">
|
||||||
|
<svg
|
||||||
|
className="animate-spin h-10 w-10 text-blue-600"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<circle
|
||||||
|
className="opacity-25"
|
||||||
|
cx="12"
|
||||||
|
cy="12"
|
||||||
|
r="10"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth="4"
|
||||||
|
></circle>
|
||||||
|
<path
|
||||||
|
className="opacity-75"
|
||||||
|
fill="currentColor"
|
||||||
|
d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
<p className="text-lg font-semibold">Loading, please wait...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -4,8 +4,7 @@ import {
|
|||||||
useMutation,
|
useMutation,
|
||||||
UseMutationResult,
|
UseMutationResult,
|
||||||
} from "@tanstack/react-query";
|
} from "@tanstack/react-query";
|
||||||
// import { insertUserSchema, User as SelectUser, InsertUser } from "@repo/db/shared/schemas";
|
import { UserUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
import { UserUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { getQueryFn, apiRequest, queryClient } from "../lib/queryClient";
|
import { getQueryFn, apiRequest, queryClient } from "../lib/queryClient";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import { Calendar } from "@/components/ui/calendar";
|
|||||||
import {
|
import {
|
||||||
AppointmentUncheckedCreateInputObjectSchema,
|
AppointmentUncheckedCreateInputObjectSchema,
|
||||||
PatientUncheckedCreateInputObjectSchema,
|
PatientUncheckedCreateInputObjectSchema,
|
||||||
} from "@repo/db/shared/schemas";
|
} from "@repo/db/usedSchemas";
|
||||||
import { apiRequest, queryClient } from "@/lib/queryClient";
|
import { apiRequest, queryClient } from "@/lib/queryClient";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { UserUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
import { UserUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
// import { insertUserSchema } from "@repo/db/shared/schemas";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { Redirect } from "wouter";
|
import { Redirect } from "wouter";
|
||||||
|
|||||||
@@ -14,10 +14,9 @@ import { useAuth } from "@/hooks/use-auth";
|
|||||||
import { apiRequest, queryClient } from "@/lib/queryClient";
|
import { apiRequest, queryClient } from "@/lib/queryClient";
|
||||||
import { AppointmentsByDay } from "@/components/analytics/appointments-by-day";
|
import { AppointmentsByDay } from "@/components/analytics/appointments-by-day";
|
||||||
import { NewPatients } from "@/components/analytics/new-patients";
|
import { NewPatients } from "@/components/analytics/new-patients";
|
||||||
import {
|
import { AppointmentUncheckedCreateInputObjectSchema } from '@repo/db/usedSchemas';
|
||||||
AppointmentUncheckedCreateInputObjectSchema,
|
import { PatientUncheckedCreateInputObjectSchema } from '@repo/db/usedSchemas';
|
||||||
PatientUncheckedCreateInputObjectSchema,
|
|
||||||
} from "@repo/db/shared/schemas";
|
|
||||||
import {
|
import {
|
||||||
Users,
|
Users,
|
||||||
Calendar,
|
Calendar,
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ import {
|
|||||||
CardHeader,
|
CardHeader,
|
||||||
CardTitle,
|
CardTitle,
|
||||||
} from "@/components/ui/card";
|
} from "@/components/ui/card";
|
||||||
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/shared/schemas";
|
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||||
// import { Patient, InsertPatient, UpdatePatient } from "@repo/db/shared/schemas";
|
|
||||||
import { apiRequest, queryClient } from "@/lib/queryClient";
|
import { apiRequest, queryClient } from "@/lib/queryClient";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Sidebar } from "@/components/layout/sidebar";
|
|||||||
import { StaffTable } from "@/components/staffs/staff-table";
|
import { StaffTable } from "@/components/staffs/staff-table";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
import { Card, CardContent } from "@/components/ui/card";
|
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 { z } from "zod";
|
||||||
import { apiRequest, queryClient } from "@/lib/queryClient";
|
import { apiRequest, queryClient } from "@/lib/queryClient";
|
||||||
import { StaffForm } from "@/components/staffs/staff-form";
|
import { StaffForm } from "@/components/staffs/staff-form";
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"exports": {
|
"exports": {
|
||||||
"./client": "./src/index.ts",
|
"./client": "./src/index.ts",
|
||||||
"./shared/schemas" : "./shared/schemas/index.ts"
|
"./shared/schemas" : "./shared/schemas/index.ts",
|
||||||
|
"./usedSchemas" : "./usedSchemas/index.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^6.7.0",
|
"@prisma/client": "^6.7.0",
|
||||||
|
|||||||
5
packages/db/usedSchemas/index.ts
Normal file
5
packages/db/usedSchemas/index.ts
Normal file
@@ -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'
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# `@turbo/eslint-config`
|
|
||||||
|
|
||||||
Collection of internal eslint configurations.
|
|
||||||
@@ -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/**"],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
@@ -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",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
39
packages/eslint-config/react-internal.js
vendored
39
packages/eslint-config/react-internal.js
vendored
@@ -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",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
Reference in New Issue
Block a user