darraghoriordan / eslint-plugin-nestjs-typed

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

New Rule: No redundant required on `@ApiProperty` #139

Open ChromeGG opened 9 months ago

ChromeGG commented 9 months ago

In many codebases I see code like

@ApiProperty({
  required: true
  // other properties like description, example etc.
})

required: true is by default in @ApiProperty, no need to override it. It provides unnecessary complexity and it's just a boilerplate. As we already have api-property-matches-property-optionality it would be nice to have something like api-property-no-redundant-required. Or we can expand api-property-matches-property-optionality and add option like "no-redundant-required".

WDYT?

darraghoriordan commented 5 months ago

Hey, yea this sounds good. feel free to submit a PR