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

Configuration

mdbook-lint can be configured through configuration files to customize its behavior for your project.

Configuration File

Create a .mdbook-lint.toml file in your project root:

# Basic settings
fail-on-warnings = false
disabled-rules = ["MD013", "MD033"]

# Rule-specific configuration
[rules.MD007]
indent = 2

[rules.MD013]
line-length = 120

Configuration Options

Global Settings

SettingTypeDefaultDescription
fail-on-warningsbooleanfalseExit with error code when warnings are found
disabled-rulesarray[]List of rule IDs to disable

Rule Configuration

Individual rules can be configured in the [rules.<RULE_ID>] sections.

MD007 - Unordered list indentation

[rules.MD007]
indent = 2  # Number of spaces for list indentation

MD013 - Line length

[rules.MD013]
line-length = 80     # Maximum line length
code-blocks = false  # Check line length in code blocks
tables = false       # Check line length in tables

Configuration Precedence

Configuration is loaded in the following order (later sources override earlier ones):

  1. Built-in defaults
  2. .mdbook-lint.toml in project root
  3. Command-line arguments

Examples

Strict Configuration

fail-on-warnings = true
disabled-rules = []  # Enable all rules

[rules.MD013]
line-length = 80

Relaxed Configuration

fail-on-warnings = false
disabled-rules = ["MD013", "MD033", "MD041"]

[rules.MD007]
indent = 4

mdBook-focused Configuration

# Disable rules that conflict with mdBook conventions
disabled-rules = ["MD025"]  # Multiple top-level headers are OK in mdBook

fail-on-warnings = true

Next Steps