Skip to content

@mmd-toolkit/er-no-unclosed-description-block ​

Disallow an accDescr { block that a } written for something else closes.

The recommended configuration does not enable this rule.

A description block ends at the first } after its {. When the } of the block is missing and a later statement holds a }, as the attribute block of an entity does, mermaid.js closes the description block there and reads the lines up to it as the description, without an error. When no } follows, mermaid.js gives an error.

Rule Details ​

This rule applies to entity relationship diagrams (erDiagram). It reports a description block with a { in its text on a later line than the opening {. It also reports a description that intentionally contains that { and has its own closing }: the rule cannot tell its } from the } of an attribute block.

A block whose closing } is on the opening line is not reported, even if that line contains another {. A block with a { on a later line is reported also when its closing } stands alone on its line, as the end of an attribute block does.

Examples of incorrect code for this rule:

mmd
%% eslint @mmd-toolkit/er-no-unclosed-description-block: error
erDiagram
  
accDescr {
x
A { string name } B

Examples of correct code for this rule:

mmd
%% eslint @mmd-toolkit/er-no-unclosed-description-block: error
erDiagram
  accDescr {
    first line
    second line
  }
  A {
    string name
  }
  B

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.