@jpeakai/mermaidjs-lint 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,27 @@
1
1
  # mermaidjs-lint
2
2
 
3
- Catch Mermaid diagrams in your markdown that fail to parse, turn unreadable in light or dark themes, or grow too big to follow.
3
+ | **[Docs](https://jpeakai.github.io/jpai-mermaidjs-lint/)** | **[Rules](https://jpeakai.github.io/jpai-mermaidjs-lint/reference/rules/)** | **[Changelog](CHANGELOG.md)** | **[npm](https://www.npmjs.com/package/@jpeakai/mermaidjs-lint)** |
4
4
 
5
- **[Docs](https://jpeakai.github.io/jpai-mermaidjs-lint/)** | **[Rules](https://jpeakai.github.io/jpai-mermaidjs-lint/reference/rules/)** | **[Changelog](CHANGELOG.md)** | **[npm](https://www.npmjs.com/package/@jpeakai/mermaidjs-lint)**
5
+ | Package Index | Published Version | Downloads | Node | CI | Docs | License |
6
+ |---|---|---|---|---|---|---|
7
+ | npm | [![npm](https://img.shields.io/npm/v/@jpeakai/mermaidjs-lint.svg)](https://www.npmjs.com/package/@jpeakai/mermaidjs-lint) | [![npm Downloads](https://img.shields.io/npm/dm/@jpeakai/mermaidjs-lint.svg)](https://www.npmjs.com/package/@jpeakai/mermaidjs-lint) | [![Node](https://img.shields.io/node/v/@jpeakai/mermaidjs-lint.svg)](https://github.com/jpeakai/jpai-mermaidjs-lint/blob/main/package.json) | [![CI](https://github.com/jpeakai/jpai-mermaidjs-lint/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jpeakai/jpai-mermaidjs-lint/actions/workflows/ci.yml) | [![Docs](https://github.com/jpeakai/jpai-mermaidjs-lint/actions/workflows/docs.yml/badge.svg)](https://jpeakai.github.io/jpai-mermaidjs-lint/) | [![License](https://img.shields.io/npm/l/@jpeakai/mermaidjs-lint.svg)](https://github.com/jpeakai/jpai-mermaidjs-lint/blob/main/LICENSE) |
8
+
9
+ I hate walls of text. I do _**love**_ a good diagram though. mermaidjs is brilliant for separating the _**semantic structure**_ of a diagram from _**the pixel pushing**_.
10
+
11
+ AI Agents love this separation too. And yet AI Agents kind of suck at diagrams though. So here is a linting and autofixer engine built on top of:
12
+ - [`mermaid`](https://www.npmjs.com/package/mermaid) parsing libraries
13
+ - [`colorjs.io`](https://www.npmjs.com/package/colorjs.io) for official [WCAG 2.1](https://colorjs.io/docs/contrast#wcag-21) colour contrast readability scoring.
6
14
 
7
15
  ## Lint your docs with one command
8
16
 
9
17
  ```sh
18
+ # bunx
19
+ bunx @jpeakai/mermaidjs-lint docs/
20
+ bunx @jpeakai/mermaidjs-lint --fix docs/
21
+
22
+ # npx
10
23
  npx -y @jpeakai/mermaidjs-lint docs/
24
+ npx -y @jpeakai/mermaidjs-lint --fix docs/
11
25
  ```
12
26
 
13
27
  ```text
@@ -31,30 +45,19 @@ Add `--fix` to apply the fixes that pass verification:
31
45
  A fix is kept only if the markdown around the diagrams is unchanged and each diagram reparses with the same node ids, subgraphs and counts.
32
46
  Edge endpoints, edge labels and node text are not compared, so review the diff.
33
47
 
34
- ## Four tenets define the tool
48
+ ## Four tenets
35
49
 
36
- Three tenets are guarantees about every diagram the tool passes, and the fourth is a commitment about the tool.
37
-
38
- - **Readable in light and dark.** Declared fills, label colours and borders are scored as the host draws them, on nodes, erDiagram rows, edge labels and sequence diagrams, in both themes.
39
- - **Renders.** Every diagram parses with the mermaid parsers this package ships, and every mermaid fence is closed.
40
- - **Simple enough to follow.** Node count and visual complexity are scored against a density preset, so an oversized diagram is flagged to be split.
41
- - **Extensible.** A plugin adds rules of your own, which run through the same config, fix engine and verification as the built-ins.
50
+ - **Always readable in light mode or dark mode.** Declared fills, label colours and borders are scored as the host draws them, on nodes, erDiagram rows, edge labels and sequence diagrams, in both themes.
51
+ - **It actually renders a valid diagram.** Every diagram parses with the mermaid parsers this package ships, and every mermaid fence is closed.
52
+ - **Visual Complexity stays readable.** Node count and visual complexity are scored against a density preset, so an oversized diagram is flagged to be split.
53
+ - **Make your own rules.** A plugin adds rules of your own, which run through the same config, fix engine and verification as the built-ins.
42
54
 
43
55
  ## Go further in the docs site
44
56
 
45
57
  - [Get started](https://jpeakai.github.io/jpai-mermaidjs-lint/get-started/): run it, fix a diagram, and add the gate to your project.
46
- - [Gate diagrams in CI](https://jpeakai.github.io/jpai-mermaidjs-lint/guides/ci/) or [before each commit](https://jpeakai.github.io/jpai-mermaidjs-lint/guides/pre-commit/).
47
- - [Configure the rules](https://jpeakai.github.io/jpai-mermaidjs-lint/guides/configure/), or [write a local rule](https://jpeakai.github.io/jpai-mermaidjs-lint/guides/local-rule/).
48
-
49
- ## Use it from an AI agent
50
-
51
- The agent skill in [`skills/mermaidjs-lint/SKILL.md`](skills/mermaidjs-lint/SKILL.md) runs the tool, applies the safe fixes, and fixes the rest by judgement.
52
- Copy it into a Claude Code project:
53
-
54
- ```sh
55
- curl -fsSL --create-dirs -o .claude/skills/mermaidjs-lint/SKILL.md \
56
- https://raw.githubusercontent.com/jpeakai/jpai-mermaidjs-lint/main/skills/mermaidjs-lint/SKILL.md
57
- ```
58
+ - [Use it in CI](https://jpeakai.github.io/jpai-mermaidjs-lint/guides/ci/) or [before each commit](https://jpeakai.github.io/jpai-mermaidjs-lint/guides/pre-commit/).
59
+ - [Configure the rules](https://jpeakai.github.io/jpai-mermaidjs-lint/guides/configure/)
60
+ - [Write a project local rule](https://jpeakai.github.io/jpai-mermaidjs-lint/guides/local-rule/).
58
61
 
59
62
  ## Runs on Bun or Node
60
63