style: update import paths and ESLint configuration
This commit is contained in:
parent
2a2c4bc967
commit
ce7e1f2952
23 changed files with 57 additions and 29 deletions
|
@ -9,8 +9,5 @@ export default defineConfig({
|
|||
},
|
||||
|
||||
e2e: {
|
||||
setupNodeEvents(on, config) {
|
||||
// implement node event listeners here
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
||||
import { PrismaClient } from '../../src/generated/prisma';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/// <reference types="cypress" />
|
||||
// ***********************************************
|
||||
// This example commands.ts shows you how to
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
// ***********************************************************
|
||||
// This example support/component.ts is processed and
|
||||
// loaded automatically before your test files.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { FlatCompat } from '@eslint/eslintrc';
|
||||
import noRelativeImportPaths from 'eslint-plugin-no-relative-import-paths';
|
||||
import { dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
|
@ -14,6 +15,21 @@ const eslintConfig = [
|
|||
{
|
||||
ignores: ['src/generated/**', '.next/**', 'public/**'],
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
'no-relative-import-paths': noRelativeImportPaths,
|
||||
},
|
||||
rules: {
|
||||
'no-relative-import-paths/no-relative-import-paths': [
|
||||
'error',
|
||||
{
|
||||
allowSameFolder: true,
|
||||
rootDir: 'src',
|
||||
prefix: "@",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default eslintConfig;
|
||||
|
|
|
@ -85,6 +85,7 @@
|
|||
"eslint": "9.30.0",
|
||||
"eslint-config-next": "15.3.4",
|
||||
"eslint-config-prettier": "10.1.5",
|
||||
"eslint-plugin-no-relative-import-paths": "^1.6.1",
|
||||
"orval": "7.10.0",
|
||||
"postcss": "8.5.6",
|
||||
"prettier": "3.6.2",
|
||||
|
|
|
@ -15,7 +15,7 @@ import { prisma } from '@/prisma';
|
|||
import {
|
||||
ParticipantResponseSchema,
|
||||
updateParticipantSchema,
|
||||
} from '../validation';
|
||||
} from '@/app/api/event/[eventID]/participant/validation';
|
||||
|
||||
export const GET = auth(async (req, { params }) => {
|
||||
const authCheck = userAuthenticated(req);
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
import {
|
||||
ParticipantResponseSchema,
|
||||
updateParticipantSchema,
|
||||
} from '../validation';
|
||||
} from '@/app/api/event/[eventID]/participant/validation';
|
||||
|
||||
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||
registry.registerPath({
|
||||
|
|
|
@ -3,16 +3,18 @@ import {
|
|||
userAuthenticated,
|
||||
} from '@/lib/apiHelpers';
|
||||
|
||||
import { auth } from '@/auth';
|
||||
import { prisma } from '@/prisma';
|
||||
|
||||
import {
|
||||
EventResponseSchema,
|
||||
updateEventSchema,
|
||||
} from '@/app/api/event/validation';
|
||||
import {
|
||||
ErrorResponseSchema,
|
||||
SuccessResponseSchema,
|
||||
ZodErrorResponseSchema,
|
||||
} from '../../validation';
|
||||
import { EventResponseSchema } from '../validation';
|
||||
import { updateEventSchema } from '../validation';
|
||||
} from '@/app/api/validation';
|
||||
|
||||
import { auth } from '@/auth';
|
||||
import { prisma } from '@/prisma';
|
||||
|
||||
export const GET = auth(async (req, { params }) => {
|
||||
const authCheck = userAuthenticated(req);
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
SuccessResponseSchema,
|
||||
} from '@/app/api/validation';
|
||||
|
||||
import { EventResponseSchema, updateEventSchema } from '../validation';
|
||||
import { EventResponseSchema, updateEventSchema } from '@/app/api/event/validation';
|
||||
|
||||
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||
registry.registerPath({
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
import { auth } from '@/auth';
|
||||
import { prisma } from '@/prisma';
|
||||
|
||||
import { ErrorResponseSchema, ZodErrorResponseSchema } from '../validation';
|
||||
import { ErrorResponseSchema, ZodErrorResponseSchema } from '@/app/api/validation';
|
||||
import {
|
||||
EventResponseSchema,
|
||||
EventsResponseSchema,
|
||||
|
|
|
@ -4,7 +4,7 @@ import zod from 'zod/v4';
|
|||
import {
|
||||
PublicUserSchema,
|
||||
existingUserIdServerSchema,
|
||||
} from '../user/validation';
|
||||
} from '@/app/api/user/validation';
|
||||
import { ParticipantSchema } from './[eventID]/participant/validation';
|
||||
|
||||
extendZodWithOpenApi(zod);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import zod from 'zod/v4';
|
||||
|
||||
import { PublicUserSchema } from '../../user/validation';
|
||||
import { PublicUserSchema } from '@/app/api/user/validation';
|
||||
|
||||
export const searchUserSchema = zod.object({
|
||||
query: zod.string().optional().default(''),
|
||||
|
|
|
@ -8,7 +8,7 @@ import { ErrorResponseSchema } from '@/app/api/validation';
|
|||
import { auth } from '@/auth';
|
||||
import { prisma } from '@/prisma';
|
||||
|
||||
import { PublicUserResponseSchema } from '../validation';
|
||||
import { PublicUserResponseSchema } from '@/app/api/user/validation';
|
||||
|
||||
export const GET = auth(async function GET(req, { params }) {
|
||||
const authCheck = userAuthenticated(req);
|
||||
|
|
|
@ -6,8 +6,8 @@ import {
|
|||
userNotFoundResponse,
|
||||
} from '@/lib/defaultApiResponses';
|
||||
|
||||
import { UserIdParamSchema } from '../../validation';
|
||||
import { PublicUserResponseSchema } from '../validation';
|
||||
import { UserIdParamSchema } from '@/app/api/validation';
|
||||
import { PublicUserResponseSchema } from '@/app/api/user/validation';
|
||||
|
||||
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||
registry.registerPath({
|
||||
|
|
|
@ -13,8 +13,8 @@ import {
|
|||
import { auth } from '@/auth';
|
||||
import { prisma } from '@/prisma';
|
||||
|
||||
import { FullUserResponseSchema } from '../../validation';
|
||||
import { updateUserPasswordServerSchema } from '../validation';
|
||||
import { FullUserResponseSchema } from '@/app/api/user/validation';
|
||||
import { updateUserPasswordServerSchema } from '@/app/api/user/me/validation';
|
||||
|
||||
export const PATCH = auth(async function PATCH(req) {
|
||||
const authCheck = userAuthenticated(req);
|
||||
|
|
|
@ -7,8 +7,8 @@ import {
|
|||
userNotFoundResponse,
|
||||
} from '@/lib/defaultApiResponses';
|
||||
|
||||
import { FullUserResponseSchema } from '../../validation';
|
||||
import { updateUserPasswordServerSchema } from '../validation';
|
||||
import { FullUserResponseSchema } from '@/app/api/user/validation';
|
||||
import { updateUserPasswordServerSchema } from '@/app/api/user/me/validation';
|
||||
|
||||
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||
registry.registerPath({
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
import { auth } from '@/auth';
|
||||
import { prisma } from '@/prisma';
|
||||
|
||||
import { FullUserResponseSchema } from '../validation';
|
||||
import { FullUserResponseSchema } from '@/app/api/user/validation';
|
||||
import { updateUserServerSchema } from './validation';
|
||||
|
||||
export const GET = auth(async function GET(req) {
|
||||
|
|
|
@ -7,8 +7,8 @@ import {
|
|||
userNotFoundResponse,
|
||||
} from '@/lib/defaultApiResponses';
|
||||
|
||||
import { SuccessResponseSchema } from '../../validation';
|
||||
import { FullUserResponseSchema } from '../validation';
|
||||
import { SuccessResponseSchema } from '@/app/api/validation';
|
||||
import { FullUserResponseSchema } from '@/app/api/user/validation';
|
||||
import { updateUserServerSchema } from './validation';
|
||||
|
||||
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '../ui/select';
|
||||
} from '@/components/ui/select';
|
||||
|
||||
type EventListEntryProps = zod.output<typeof EventSchema>;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
} from '@/generated/api/event/event';
|
||||
import { useGetApiUserMe } from '@/generated/api/user/user';
|
||||
|
||||
import ParticipantListEntry from '../custom-ui/participant-list-entry';
|
||||
import ParticipantListEntry from '@/components/custom-ui/participant-list-entry';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
|
@ -33,7 +33,7 @@ import {
|
|||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from '../ui/dialog';
|
||||
} from '@/components/ui/dialog';
|
||||
|
||||
type User = zod.output<typeof PublicUserSchema>;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import React from 'react';
|
||||
|
||||
import { SidebarProvider } from '../custom-ui/sidebar';
|
||||
import { SidebarProvider } from '@/components/custom-ui/sidebar';
|
||||
|
||||
export default function SidebarProviderWrapper({
|
||||
defaultOpen,
|
||||
|
|
|
@ -5718,6 +5718,13 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint-plugin-no-relative-import-paths@npm:^1.6.1":
|
||||
version: 1.6.1
|
||||
resolution: "eslint-plugin-no-relative-import-paths@npm:1.6.1"
|
||||
checksum: 10c0/952d136ae959408d7f50fc6a630a010421ac39e7b8ccb0980817ae058941d19d6abe60233eabb5e9f32198de17d5d6ce9432f87ee8e2f2a243d71605b2e247ef
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint-plugin-react-hooks@npm:^5.0.0":
|
||||
version: 5.2.0
|
||||
resolution: "eslint-plugin-react-hooks@npm:5.2.0"
|
||||
|
@ -7860,6 +7867,7 @@ __metadata:
|
|||
eslint: "npm:9.30.0"
|
||||
eslint-config-next: "npm:15.3.4"
|
||||
eslint-config-prettier: "npm:10.1.5"
|
||||
eslint-plugin-no-relative-import-paths: "npm:^1.6.1"
|
||||
lucide-react: "npm:^0.525.0"
|
||||
next: "npm:15.3.4"
|
||||
next-auth: "npm:^5.0.0-beta.25"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue