English
@mmd-toolkit/sequence-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 it has no effect.
Rule Details
This rule applies to sequence diagrams (sequenceDiagram). 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.
An empty block is reported also where it shares a line with a statement, before it or after its last part, where it follows the header on its line, and inside a box.
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/sequence-no-empty-description-block: error
sequenceDiagram
A ->> B: x
accDescr {}mmd
%% eslint @mmd-toolkit/sequence-no-empty-description-block: error
sequenceDiagram
A ->> B: x
accDescr { }mmd
%% eslint @mmd-toolkit/sequence-no-empty-description-block: error
sequenceDiagram
A ->> B: x
accDescr {
}Examples of correct code for this rule:
mmd
%% eslint @mmd-toolkit/sequence-no-empty-description-block: error
sequenceDiagram
accDescr {
a
b
}mmd
%% eslint @mmd-toolkit/sequence-no-empty-description-block: error
sequenceDiagram
A ->> B: x
accDescr {
%% c
}Options
This rule has no options.
Related Rules
- flowchart-no-empty-description-block
- sequence-no-unclosed-description-block
- sequence-no-duplicate-description
Version
This rule was introduced in @mmd-toolkit/eslint-plugin v0.1.0.