docfy lint

Checks documentation quality, not just presence. Catches incomplete ApiOperation, ApiResponse, and ApiBody decorators that check and coverage wouldn't flag.

Usage

bash
npx nestjs-docfy lint [options]

Options

OptionDefaultDescription
--root <path>.Project root directory
--tsconfig <path>auto-detectedPath to tsconfig.json
--pattern <glob>**/*.controller.tsGlob pattern to find controllers
--format <format>tsDocs file format to look for: ts or js
--quietfalseSuppress all output except errors

What it checks

For every method already present in a docs file:

  • ApiOperation missing a summary
  • Endpoints with a @Body() parameter missing an ApiResponse 400
  • Endpoints with a @Body() parameter missing an ApiBody description

Controllers without a companion docs file, or methods not yet documented at all, are left to check; lint only judges the quality of what's already there.

Example output

text
✖ POST /users
  Missing 400 response

✖ GET /users
  Missing operation summary

✖ PATCH /users/:id
  Missing request body description

✖ 3 issue(s) found.

Exits with code 1 if any issue is found, designed for CI, same as check.

.github/workflows/*.yml
# GitHub Actions example
- name: Lint documentation quality
  run: npx nestjs-docfy lint