Skip to content

Linting Rules

View Markdown

Clean diagrams aren’t accidental. They’re enforced.

tlDiagram’s linter checks every diagram for architectural anti-patterns. Run it with tld validate.

These are heuristic checks for common issues that lead to messy, unreadable diagrams. They’re advisory and constantly evolving.

The level is a global setting:

Terminal window
tld config set validation.level 2

Or override per run:

Terminal window
tld validate --strictness 3
tld validate --strictness 1

Disable specific rule codes:

Terminal window
tld config set validation.exclude_rules ARC002,ARC203

Or enable additional rules beyond the selected level:

Terminal window
tld config set validation.include_rules ARC001,ARC004

validation.allow_low_insight is a shortcut that turns ARC005 (Low Insight Ratio) off.

CodeRuleWhat it flags
ARC001High DensityA view has too many elements to read
ARC002Isolated ElementAn element has no connectors in its view
ARC003Shared ContextA reused element has no connectors in one of its views
ARC004Depth MismatchThe view hierarchy is too flat
ARC005Low Insight RatioA view has mostly elements and few connectors
ARC006Dead-End DrilldownAn element owns a view with no content
ARC007Abstraction LeakFunctions or classes placed at the root level
ARC008Unresolved ConnectorA connector endpoint has no element definition
CodeRuleWhat it flags
ARC102Missing TechAn element has no technology field
ARC207Unknown TechnologyA technology isn’t in the catalog
CodeRuleWhat it flags
ARC201Missing DescAn element has no description
ARC202Generic NamingA vague, non-domain-specific name
ARC203Missing LabelA connector has no label
ARC204Duplicate NameMultiple elements share a display name
ARC205Low GroundingA view has too few source-linked elements
ARC206Low Link CoverageLinks cover too little of the indexed code directories

Drill into any rule with its code:

Terminal window
tld validate ARC001

Warnings appear in tld validate output and the editor. They are advisory unless you pass --strict, which makes them fail validation. Run tld validate rules for the current catalog.

A warning means “this might be a problem.” It’s your call whether to address it or acknowledge it.