Skip to content

@mmd-toolkit/packet-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 empty accDescr {} block without an error. Written first, it changes nothing; after a description, it removes that description.

Rule Details ​

This rule applies to packet diagrams (packet and packet-beta). It reports an accDescr block holding nothing or only whitespace between its braces. A block holding only directives is also reported, although mermaid.js still applies their settings.

A block with a comment line inside its braces, as a block left to be filled in later, is not reported by this rule. After a description, that block still clears it and is reported by packet-no-duplicate-description. 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/packet-no-empty-description-block: error
packet
  
accDescr {}
0-15: "Source Port"

Examples of correct code for this rule:

mmd
%% eslint @mmd-toolkit/packet-no-empty-description-block: error
packet
  accDescr {
    Fields of a TCP header
    from the first bit
  }
  0-15: "Source Port"

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.