Contents
Contents

A code block is missing a specified language.

This rule is currently experimental and not yet available in a stable SDK.

Details

#

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

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

See highlight.js for the list of languages supported by dart doc.

BAD:

dart
/// ```
/// void main() {}
/// ```
class A {}

GOOD:

dart
/// ```dart
/// void main() {}
/// ```
class A {}

Usage

#

To enable the missing_code_block_language_in_doc_comment rule, add missing_code_block_language_in_doc_comment under linter > rules in your analysis_options.yaml file:

analysis_options.yaml
yaml
linter:
  rules:
    - missing_code_block_language_in_doc_comment