docfy lint

Prüft die Qualität der Dokumentation, nicht nur ihr Vorhandensein. Erkennt unvollständige ApiOperation-, ApiResponse- und ApiBody-Decorators, die check und coverage nicht bemängeln würden.

Verwendung

bash
npx nestjs-docfy lint [options]

Optionen

OptionDefaultDescription
--root <path>.Project root directory
--tsconfig <path>auto-detectedPath to tsconfig.json
--pattern <glob>**/*.controller.tsGlob pattern to find controllers
--format <format>tsZu suchendes Docs-Dateiformat: ts oder js
--quietfalseSuppress all output except errors

Was geprüft wird

Für jede bereits in einer Docs-Datei vorhandene Methode:

  • ApiOperation ohne summary
  • Endpunkte mit einem @Body()-Parameter ohne ApiResponse 400
  • Endpunkte mit einem @Body()-Parameter ohne ApiBody-description

Controller ohne Companion-Docs-Datei oder noch überhaupt nicht dokumentierte Methoden überlässt lint check; lint beurteilt nur die Qualität dessen, was bereits vorhanden ist.

Beispielausgabe

text
✖ POST /users
  Missing 400 response

✖ GET /users
  Missing operation summary

✖ PATCH /users/:id
  Missing request body description

✖ 3 issue(s) found.

Beendet sich mit Code 1, wenn ein Problem gefunden wird – gedacht für CI, genau wie check.

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