validating-nestjs-dtos
Installation
SKILL.md
Validating NestJS DTOs
When to use
- Adding or refactoring DTOs
- Hardening boundary input
- Removing manual validation from controllers
Core rules
- Global
ValidationPipewithwhitelist: true,forbidNonWhitelisted: true - DTOs use
class-validatordecorators:@IsEmail(),@IsString(),@MinLength() - Use
@Type()from class-transformer for type conversion - No manual validation in controllers
- DTOs in
application/dtos/folder