eslint-plugin-nestjs-typed
eslint-plugin-nestjs-typed copied to clipboard
api-property-matches-property-optionality gets confused when property has default provided
This is bit of a grey area but still would be nice if we wouldn't need to disable @darraghor/nestjs-typed/api-property-matches-property-optionality
for every such property
@IsOptional()
@IsString()
@Expose()
@ApiPropertyOptional({
type: String,
default: 'example',
})
label: string = 'example';
@ApiPropertyOptional
tells that users don't need to provide this data in body and it will be filled in with default
Can we add an option for the rule to accept @IsOptional
if default is provided in @ApiPropertyOptional
and property is required
Yes, if you submit a PR for this it would be awesome. Thank you!