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