CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/nestjs-best-practices

NestJS patterns -- modules, DI, exception filters, validation pipes, guards, interceptors, testing, config

98

1.36x
Quality

89%

Does it follow best practices?

Impact

100%

1.36x

Average score across 12 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-2/

{
  "context": "Tests whether the agent correctly implements nested DTO validation using both @ValidateNested and @Type, configures the global ValidationPipe with the required options, and wraps all controller responses in a { data: ... } envelope.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "@ValidateNested present",
      "description": "The nested items array field in the DTO has the @ValidateNested({ each: true }) decorator",
      "max_score": 10
    },
    {
      "name": "@Type present",
      "description": "The nested items array field also has @Type(() => <ItemDto>) from class-transformer — not just @ValidateNested alone",
      "max_score": 12
    },
    {
      "name": "whitelist: true",
      "description": "ValidationPipe is configured with whitelist: true",
      "max_score": 8
    },
    {
      "name": "transform: true",
      "description": "ValidationPipe is configured with transform: true",
      "max_score": 8
    },
    {
      "name": "forbidNonWhitelisted: true",
      "description": "ValidationPipe is configured with forbidNonWhitelisted: true",
      "max_score": 8
    },
    {
      "name": "Global pipe in main.ts",
      "description": "ValidationPipe is registered globally via app.useGlobalPipes() in main.ts (not on individual controllers)",
      "max_score": 8
    },
    {
      "name": "POST response envelope",
      "description": "The POST orders controller action returns { data: <result> } rather than returning the raw service result",
      "max_score": 10
    },
    {
      "name": "GET response envelope",
      "description": "Any GET endpoint(s) in the orders controller also return { data: <result> }",
      "max_score": 8
    },
    {
      "name": "Feature module structure",
      "description": "Orders code is in a dedicated feature module folder (e.g. src/orders/) with separate module, controller, service, and DTO files",
      "max_score": 8
    },
    {
      "name": "Constructor injection",
      "description": "OrdersService receives its dependencies via constructor parameters, not instantiated with new inside the class",
      "max_score": 10
    },
    {
      "name": "@Injectable on service",
      "description": "OrdersService is decorated with @Injectable()",
      "max_score": 10
    }
  ]
}

evals

tile.json