Skip to content

@mmd-toolkit/agentflow-no-duplicate-description ​

Disallow an accDescr that replaces the description set before it.

✅ The recommended configuration enables this rule.

💡 This rule is manually fixable by editor suggestions.

An agentflow-beta diagram has one accessible description, which accDescr sets. A later accDescr replaces it without an error, and the earlier description is lost.

Rule Details ​

This rule applies to agentflow diagrams (agentflow-beta). It reports an accDescr statement that changes a description set by an earlier statement. The line and block forms are compared together, including statements inside a flow or a global block, which set the description of the whole diagram.

With no text after accDescr:, the next line with text supplies the description, past empty lines and directives; with no such line, the description becomes empty. Comment lines count as description text, including inside a block. Empty blocks and unclosed blocks are not counted by this rule.

Repeating the current description is not reported. Comparisons ignore whitespace at the ends and after each line break, including indentation and empty lines in blocks, and treat LF, CRLF, and CR as LF. Otherwise descriptions are compared as written, so differences in character references or HTML attribute quotes can be reported even when mermaid.js reads them as the same description.

Examples of incorrect code for this rule:

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

Examples of correct code for this rule:

mmd
%% eslint @mmd-toolkit/agentflow-no-duplicate-description: error
agentflow-beta TB
  accDescr {
    A longer
    description
  }

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.