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
| Option | Default | Description |
|---|---|---|
--root <path> | . | Project root directory |
--tsconfig <path> | auto-detected | Path to tsconfig.json |
--pattern <glob> | **/*.controller.ts | Glob pattern to find controllers |
--format <format> | ts | Zu suchendes Docs-Dateiformat: ts oder js |
--quiet | false | Suppress all output except errors |
Was geprüft wird
Für jede bereits in einer Docs-Datei vorhandene Methode:
ApiOperationohnesummary- Endpunkte mit einem
@Body()-Parameter ohneApiResponse400 - Endpunkte mit einem
@Body()-Parameter ohneApiBody-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