denoland/deno · error
Found {} documentation lint error{}.
Error message
Found {} documentation lint error{}. What it means
`deno doc --lint` collects documentation diagnostics (e.g. missing JSDoc on exported symbols, broken doc references), prints each one in full via DisplayDocDiagnostic above the summary, then bails with the total count (singular/pluralized). The bail itself is just the failure summary — the actionable detail is in the per-diagnostic output preceding it.
Source
Thrown at cli/tools/doc.rs:752
.entry(diagnostic.location.filename.clone())
.or_insert_with(BTreeMap::new)
.entry(diagnostic.location.line)
.or_insert_with(BTreeMap::new)
.entry(diagnostic.location.col)
.or_insert_with(Vec::new)
.push(diagnostic);
}
for (_, diagnostics_by_lc) in diagnostic_groups {
for (_, diagnostics_by_col) in diagnostics_by_lc {
for (_, diagnostics) in diagnostics_by_col {
for diagnostic in diagnostics {
log::error!("{}\n", DisplayDocDiagnostic(diagnostic).display());
}
}
}
}
bail!(
"Found {} documentation lint error{}.",
colors::bold(diagnostics.len().to_string()),
if diagnostics.len() == 1 { "" } else { "s" }
);
}
View on GitHub (pinned to f7822238ca)
Solutions
- Read each printed diagnostic above the summary — it gives file, line, and what's missing.
- Add the required JSDoc (description and any demanded tags) to each flagged export.
- Fix or remove broken {@link}/reference targets in doc comments.
- Re-run until the count reaches zero before pushing.
Example fix
// before
export function add(a: number, b: number): number {
return a + b;
}
// after
/** Adds two numbers. */
export function add(a: number, b: number): number {
return a + b;
} Defensive patterns
Strategy: try-catch
Try / catch
# CI: capture diagnostics, fail with context if ! deno doc --lint src/ > doclint.log 2>&1; then echo "doc lint failed:"; grep -c 'lint error' doclint.log || true cat doclint.log exit 1 fi
Prevention
- Run `deno doc --lint` locally on changed modules before pushing; keep the count at zero as a habit.
- Write JSDoc at export time rather than retro-fitting before releases.
- Gate PRs on doc lint so the error count never accumulates into the hundreds.
When it happens
Trigger: Running `deno doc --lint` over a codebase where exported symbols lack the required JSDoc, or doc comments contain broken references. Every diagnostic found across all files increments the reported count.
Common situations: Enabling doc lint on an existing codebase for the first time; CI gates that run `deno doc --lint`; new exports added without JSDoc in repos where the lint is enforced.
Related errors
- Node {} was not found!
- The bench name can't be empty
- BenchContext::end() has already been invoked
- deno ci requires a lockfile, but none was found. hint: run
- No rules have been configured
AI-assisted analysis of denoland/deno@f7822238ca (2026-08-20).
Data as JSON: /api/errors/8bbb9db87e9b6167.
Report an issue: GitHub.