darraghoriordan / eslint-plugin-nestjs-typed

Some eslint rules for working with NestJs projects
http://www.darraghoriordan.com
171 stars 34 forks source link

ApiPropertOptional #133

Closed YohoCX closed 9 months ago

YohoCX commented 9 months ago

I don't know what's wrong with this, but it requires me to use @ApiPropertyOptional, even If I use it, it still gives me an error

  @ApiPropertyOptional()
  @ApiProperty({ description: 'If it is an event, use dateFrom and dateTo' })
  @IsOptional()
  @IsDate()
  dateFrom?: Date;

  @ApiPropertyOptional({})
  @IsOptional()
  @ApiProperty({ description: 'If it is an event, use dateFrom and dateTo' })
  dateTo?: Date;

ESLint: Property marked as optional should use @ApiPropertyOptional decorator(@darraghor/nestjs-typed/api-property-matches-property-optionality