Validate Dart documentation comments

dart-doc-validationskillsetup L12,371
flutter/skills
What it does

Validate Dart documentation comments for broken links

Best for

Catching broken documentation links and macro errors before publishing a Dart package to pub.dev.

Inputs
  • · Dart source files with documentation comments (///)
  • · analysis_options.yaml configuration file
Outputs
  • · Validation warnings (unresolved doc reference, undefined macro)
  • · Fixed analysis_options.yaml with comment_references lint enabled
  • · Corrected documentation comments
Requires
  • · dart doc CLI (generates HTML to temp directory)
  • · dart analyzer (resolves references)
  • · optional: dhttpd package (for local browsing)
Preconditions
  • · Dart project with analysis_options.yaml
  • · Dart SDK installed with dart command available
Failure modes
  • · Unresolved doc reference [Identifier]: check identifier scope and imports
  • · Undefined macro {{{@macro macro_name}}}: verify template definition exists
Trust signals
  • · dart doc command validates actual HTML generation
  • · comment_references lint catches missing identifier definitions
  • · Temporary output directory avoids cluttering project workspace