Skip to content

@mmd-toolkit/requirement-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 body of a requirement or an element 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 requirement diagrams (requirementDiagram). 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 a body. A block whose closing } is on the opening line is not reported, even if that line contains another {.

Examples of incorrect code for this rule:

mmd
%% eslint @mmd-toolkit/requirement-no-unclosed-description-block: error
requirementDiagram
  
accDescr {
x
requirement r { id: 1 } element e { type: simulation }

Examples of correct code for this rule:

mmd
%% eslint @mmd-toolkit/requirement-no-unclosed-description-block: error
requirementDiagram
  accDescr {
    first line
    second line
  }
  requirement r {
    id: 1
  }
  element e {
    type: simulation
  }

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.