NestJS patterns -- modules, DI, exception filters, validation pipes, guards, interceptors, testing, config
98
89%
Does it follow best practices?
Impact
100%
1.36xAverage score across 12 eval scenarios
Passed
No known issues
Dependency injection and service separation
No new in service
100%
100%
Constructor injection in service
100%
100%
@Injectable on NotificationsService
100%
100%
@Injectable on SmsService
100%
100%
@Injectable on EmailService
100%
100%
Controller delegates to service
100%
100%
No Request/Response in service
100%
100%
Providers registered in module
100%
100%
Response envelope
0%
100%
No new in controller
100%
100%
@ValidateNested present
100%
100%
@Type present
100%
100%
whitelist: true
100%
100%
transform: true
0%
100%
forbidNonWhitelisted: true
100%
100%
Global pipe in main.ts
100%
100%
POST response envelope
0%
100%
GET response envelope
0%
100%
Feature module structure
100%
100%
Constructor injection
100%
100%
@Injectable on service
100%
100%
Response data envelope
0%
100%
Error envelope shape
0%
100%
console.error for unknown errors
0%
100%
ConfigModule isGlobal
100%
100%
No process.env in service
100%
100%
No new EmailService
100%
100%
Test.createTestingModule used
100%
100%
Dependencies mocked in tests
100%
100%
Global ValidationPipe
100%
100%
Global filter in main.ts
100%
100%
Catch-all filter decorator
0%
100%
DTO with class-validator
100%
100%
@Catch() no args
100%
100%
HttpException error shape
0%
100%
Unknown error shape
0%
100%
console.error for unknown
100%
100%
Global filter in main.ts
100%
100%
Implements ExceptionFilter
100%
100%
HttpException status code
100%
100%
500 for unknown
100%
100%
Filter file location
100%
100%
ValidationPipe global
100%
100%
Error envelope shape
0%
100%
Response data envelope
0%
100%
console.error for unknown errors
0%
100%
Global ValidationPipe with whitelist and transform
100%
100%
Performance logging interceptor with tap
100%
100%
Interceptor logs method URL duration
100%
100%
Catch-all filter decorator
100%
100%
Global filter in main.ts
100%
100%
DTO with class-validator decorators
100%
100%
Feature module structure
100%
100%
Filter in common/filters
100%
100%