Skip to content

proposal: missing_code_block_language_in_doc_comment #59420

Closed
@kallentu

Description

@kallentu

missing_code_block_language_in_doc_comment

Description

A fenced code block is missing a specified language.

Details

To enable proper syntax highlighting of Markdown code blocks, dart doc requires code blocks to specify the language used after the initial declaration.

Kind

It guards against syntax highlighting errors.

DO specify the language used in the code block of a doc comment.

Bad Examples

/// ```
/// void main() {}
/// ```
/// ~~~
/// void main() {}
/// ~~~

Good Examples

/// ```dart
/// void main() {}
/// ```
/// ~~~dart
/// void main() {}
/// ~~~

Discussion

This migrates Dartdoc's missingCodeBlockLanguage warning to the linter for the clean up of Dartdoc.

cc. @srawlins @goderbauer @pq

Discussion checklist

  • List any existing rules this proposal modifies, complements, overlaps or conflicts with.
  • List any relevant issues (reported here, the SDK Tracker, or elsewhere).
  • If there's any prior art (e.g., in other linters), please add references here.
  • If this proposal corresponds to Effective Dart or Flutter Style Guide advice, please call it out. (If there isn't any corresponding advice, should there be?)
  • If this proposal is motivated by real-world examples, please provide as many details as you can. Demonstrating potential impact is especially valuable.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions