Skip to content

@mmd-toolkit/agentflow-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.

An accDescr block is written to give the diagram a description. mermaid.js accepts a closed block with nothing in it without an error, but it sets no description.

Rule Details ​

This rule applies to agentflow diagrams (agentflow-beta). It reports a closed accDescr block containing nothing or only whitespace. Directives do not count as text, so a block containing only directives is reported, although mermaid.js applies their settings.

A comment line counts as description text, so a block containing one is not empty.

Empty blocks are also reported after a statement or the header, in a flow or connector name, or before the URL or tooltip of a click statement.

The formatter prints an empty block as accDescr {}. The example with whitespace inside the braces is shown as written.

Examples of incorrect code for this rule:

mmd
%% eslint @mmd-toolkit/agentflow-no-empty-description-block: error
agentflow-beta TB
  A
  
accDescr {
}
mmd
%% eslint @mmd-toolkit/agentflow-no-empty-description-block: error
agentflow-beta TB
  flow F 
accDescr {}
A end

Examples of correct code for this rule:

mmd
%% eslint @mmd-toolkit/agentflow-no-empty-description-block: error
agentflow-beta TB
  accDescr {
    first
    second
  }
  A

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.