darraghoriordan / eslint-plugin-nestjs-typed

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

New Rule Suggestion: Swagger Capitalized Summery/Description #179

Open shanike opened 5 months ago

shanike commented 5 months ago

Hi! In my project, I expect ApiProperty#Summary and ApiProperty#Description to start with an upper-cased letter.

Example:

PASSES:

  @ApiOperation({
    summary: "Clears the access-token cookie", // <<<<<<------------------------- c (upper case)
  })
  @Post("logout")
  postLogout(@Res() res: Response) {
  // ...
  }

FAILES:

  @ApiOperation({
    summary: "clears the access-token cookie", // <<<<<<------------------------- C (lower case)
  })
  @Post("logout")
  postLogout(@Res() res: Response) {
  // ...
  }
darraghoriordan commented 5 months ago

this could be a good first rule for someone! isUpper() or regex is a pretty easy check