Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

lineWidth

Fallback line width for formatting decisions when maxInlineTagWidth is not set.

Typenumber
Default100 (from global config)
Minimum1

When maxInlineTagWidth is omitted, its value equals lineWidth. This controls when the formatter wraps attributes or children onto new lines.

Example

lineWidth: 60

Short line width forces earlier wrapping:

<!-- input -->
<svg><rect x="10" y="20" width="100" height="50" fill="#ff0000" stroke="#000" /></svg>
<!-- output -->
<svg>
  <rect
    x="10"
    y="20"
    width="100"
    height="50"
    fill="#ff0000"
    stroke="#000" />
</svg>

lineWidth: 200

Wide line width keeps short tags inline:

<!-- input -->
<svg><rect x="10" y="20" width="100" height="50" fill="#ff0000" stroke="#000" /></svg>
<!-- output -->
<svg>
  <rect x="10" y="20" width="100" height="50" fill="#ff0000" stroke="#000" />
</svg>

Config

{
  "svg": {
    "lineWidth": 80
  }
}