English
@mmd-toolkit/flowchart-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. When it contains nothing or only whitespace, mermaid.js accepts it without an error but takes no description from it.
Rule Details
This rule applies to flowcharts (flowchart, graph, flowchart-elk, and swimlane-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 block containing a comment line is not reported, including when it also contains directives, because comments can mark a description left to be filled in later.
Empty blocks are also reported after a statement or the header on the same line.
The formatter prints an empty block as accDescr {}. The examples with whitespace inside the braces are shown as written.
Examples of incorrect code for this rule:
mmd
%% eslint @mmd-toolkit/flowchart-no-empty-description-block: error
flowchart LR
A
accDescr {}mmd
%% eslint @mmd-toolkit/flowchart-no-empty-description-block: error
flowchart LR
A
accDescr { }mmd
%% eslint @mmd-toolkit/flowchart-no-empty-description-block: error
flowchart LR
A
accDescr {
}Examples of correct code for this rule:
mmd
%% eslint @mmd-toolkit/flowchart-no-empty-description-block: error
flowchart LR
A
accDescr {
first line
second line
}mmd
%% eslint @mmd-toolkit/flowchart-no-empty-description-block: error
flowchart LR
A
accDescr {
%% c
}Options
This rule has no options.
Related Rules
Version
This rule was introduced in @mmd-toolkit/eslint-plugin v0.1.0.