English
@mmd-toolkit/er-no-ignored-text
Disallow text that mermaid.js drops.
The recommended configuration does not enable this rule.
A direction statement is written on a line of its own. When the line also holds other text, mermaid.js reads the whole line as the direction statement and drops the rest without an error.
Rule Details
This rule applies to entity relationship diagrams (erDiagram). It reports text on a direction line before direction or after its value. Text after the value that starts with %% is not reported: the author means it as a comment, and mermaid.js drops it as meant. A relationship whose role contains direction, as in A ||--o{ B : direction TB, is reported too: mermaid.js reads it as a direction line and draws no relationship.
The rule also reports empty backquotes, two backquotes with nothing between them, anywhere in the attribute block of an entity: mermaid.js skips them. A run of empty backquotes separated only by whitespace, comment lines, or directives gives one report.
Examples of incorrect code for this rule:
mmd
%% eslint @mmd-toolkit/er-no-ignored-text: error
erDiagram
A ||--o{ B : x direction LRmmd
%% eslint @mmd-toolkit/er-no-ignored-text: error
erDiagram
direction LR x
AExamples of correct code for this rule:
mmd
%% eslint @mmd-toolkit/er-no-ignored-text: error
erDiagram
direction LR
A ||--o{ B : xmmd
%% eslint @mmd-toolkit/er-no-ignored-text: error
erDiagram
direction LR %% c
AOptions
This rule has no options.
Related Rules
Version
This rule was introduced in @mmd-toolkit/eslint-plugin v0.1.0.