English
@mmd-toolkit/eventmodeling-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 accDescr {} block with nothing in it without an error. The block gives no description of its own: mermaid.js sets the text of the statement, as accDescr {}, as the description, and after a description, the block removes that description.
Rule Details
This rule applies to Event Modeling diagrams (eventmodeling). It reports an accDescr block with nothing or only whitespace between its braces. Directives are not description text, so a block containing only directives is also reported, though mermaid.js applies their settings.
A block containing a comment line between its braces is not reported, because mermaid.js keeps the comment line as the text of the description. After a description, such a block replaces it, and eventmodeling-no-duplicate-description reports it. 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/eventmodeling-no-empty-description-block: error
eventmodeling accDescr {}
tf 01 evt BoughtExamples of correct code for this rule:
mmd
%% eslint @mmd-toolkit/eventmodeling-no-empty-description-block: error
eventmodeling accDescr { Checkout flow }
tf 01 evt Boughtmmd
%% eslint @mmd-toolkit/eventmodeling-no-empty-description-block: error
eventmodeling accDescr {
%% TODO
}
tf 01 evt BoughtOptions
This rule has no options.
Related Rules
Version
This rule was introduced in @mmd-toolkit/eslint-plugin v0.1.0.