fix: production readiness — resolve build, lint, and code quality issues
- Fix Next.js build failure: remove duplicate route at (dashboard)/listings/[id] that conflicted with (public)/listings/[id] (same URL path in two route groups) - Fix 772 ESLint errors: auto-fix import ordering (import-x/order), remove unused imports/variables, convert empty interfaces to type aliases, replace require() with ESM imports, fix consistent-type-imports violations - Add CLAUDE.md for developer onboarding documentation - All checks pass: 0 lint errors, typecheck clean, 230 tests passing, build success Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest';
|
||||
import { DomainException } from '../../domain/domain-exception';
|
||||
import { ErrorCode } from '../../domain/error-codes';
|
||||
import { GlobalExceptionFilter } from '../filters/global-exception.filter';
|
||||
import { LoggerService } from '../logger.service';
|
||||
import { type LoggerService } from '../logger.service';
|
||||
|
||||
function createMockHost(correlationId?: string) {
|
||||
const json = vi.fn();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable, Inject, type OnModuleInit } from '@nestjs/common';
|
||||
import { Injectable, type OnModuleInit } from '@nestjs/common';
|
||||
import { InjectMetric } from '@willsoto/nestjs-prometheus';
|
||||
import { Counter } from 'prom-client';
|
||||
import { RedisService } from './redis.service';
|
||||
import { LoggerService } from './logger.service';
|
||||
import { type Counter } from 'prom-client';
|
||||
import { type LoggerService } from './logger.service';
|
||||
import { type RedisService } from './redis.service';
|
||||
|
||||
export const CACHE_HIT_TOTAL = 'cache_hit_total';
|
||||
export const CACHE_MISS_TOTAL = 'cache_miss_total';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { type EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { type DomainEvent } from '../domain/domain-event';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import type { Request, Response } from 'express';
|
||||
import { DomainException, type ErrorResponseBody } from '../../domain/domain-exception';
|
||||
import { ErrorCode } from '../../domain/error-codes';
|
||||
import { LoggerService } from '../logger.service';
|
||||
import { type LoggerService } from '../logger.service';
|
||||
|
||||
@Catch()
|
||||
export class GlobalExceptionFilter implements ExceptionFilter {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable, type NestMiddleware } from '@nestjs/common';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { Injectable, type NestMiddleware } from '@nestjs/common';
|
||||
import type { NextFunction, Request, Response } from 'express';
|
||||
|
||||
const CORRELATION_ID_HEADER = 'x-correlation-id';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ForbiddenException, Injectable, type NestMiddleware } from '@nestjs/common';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { ForbiddenException, Injectable, type NestMiddleware } from '@nestjs/common';
|
||||
import type { NextFunction, Request, Response } from 'express';
|
||||
|
||||
const CSRF_COOKIE = 'XSRF-TOKEN';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable, type NestMiddleware } from '@nestjs/common';
|
||||
import type { NextFunction, Request, Response } from 'express';
|
||||
import { LoggerService } from '../logger.service';
|
||||
import { type LoggerService } from '../logger.service';
|
||||
|
||||
@Injectable()
|
||||
export class RequestLoggingMiddleware implements NestMiddleware {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Global, type MiddlewareConsumer, Module, type NestModule, RequestMethod
|
||||
import { APP_FILTER } from '@nestjs/core';
|
||||
import { EventEmitterModule } from '@nestjs/event-emitter';
|
||||
import { makeCounterProvider } from '@willsoto/nestjs-prometheus';
|
||||
import { CacheService, CACHE_HIT_TOTAL, CACHE_MISS_TOTAL } from './infrastructure/cache.service';
|
||||
import { EventBusService } from './infrastructure/event-bus.service';
|
||||
import { GlobalExceptionFilter } from './infrastructure/filters/global-exception.filter';
|
||||
import { LoggerService } from './infrastructure/logger.service';
|
||||
@@ -11,7 +12,6 @@ import { RequestLoggingMiddleware } from './infrastructure/middleware/request-lo
|
||||
import { SanitizeInputMiddleware } from './infrastructure/middleware/sanitize-input.middleware';
|
||||
import { PrismaService } from './infrastructure/prisma.service';
|
||||
import { RedisService } from './infrastructure/redis.service';
|
||||
import { CacheService, CACHE_HIT_TOTAL, CACHE_MISS_TOTAL } from './infrastructure/cache.service';
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
|
||||
Reference in New Issue
Block a user