Skip to content

@mmd-toolkit/gitgraph-no-empty-description-block ​

Disallow an accDescr block that holds no description.

✅ The recommended configuration enables this rule.

💡 This rule is manually fixable by editor suggestions.

mermaid.js accepts an empty accDescr {} block without an error. Written first, it changes nothing; after a description, it removes that description.

Rule Details ​

This rule applies to Git graphs (gitGraph). It reports an accDescr block holding nothing or only whitespace between its braces. A block holding only directives is also reported, although mermaid.js still applies their settings.

A block with a comment line inside its braces, as a block left to be filled in later, is not reported by this rule. After a description, that block still clears it and is reported by gitgraph-no-duplicate-description. A comment outside the braces, as in accDescr {} %% later, does not prevent a report.

Examples of incorrect code for this rule:

mmd
%% eslint @mmd-toolkit/gitgraph-no-empty-description-block: error
gitGraph
  
accDescr {}
commit

Examples of correct code for this rule:

mmd
%% eslint @mmd-toolkit/gitgraph-no-empty-description-block: error
gitGraph
  accDescr {
    Detailed description
    across multiple lines
  }
  commit

Options ​

This rule has no options.

Version ​

This rule was introduced in @mmd-toolkit/eslint-plugin v0.1.0.

Resources ​

Third-party tools for Mermaid diagram text.