Skip to content

MD029 - ol-prefix

Description

This rule ensures that ordered list item prefixes follow a consistent pattern. The style setting controls which numbering pattern is enforced: one requires all items use '1.', ordered requires sequential numbering starting from 0 or 1, zero requires all items use '0.', and one_or_ordered (default) accepts either the 'one' or 'ordered' patterns, auto-detecting which is in use from the first two items.

Rationale

Consistent formatting makes it easier to understand a document. Using '1.' for all items simplifies reordering since items can be moved without renumbering, while sequential numbering provides explicit ordering at a glance.

Configuration

style

Required ordered list prefix style.

  • Default: one_or_ordered
  • Options:
    • one: All list items must use '1.' as the prefix
    • ordered: List items must use sequential numbering starting from 0 or 1 (e.g. 1, 2, 3 or 0, 1, 2)
    • one_or_ordered: Either 'one' or 'ordered' style is acceptable (auto-detected)
    • zero: All list items must use '0.' as the prefix

Examples

Invalid

# Ordered List with Inconsistent Prefixes

1. First item
3. Second item
2. Third item

Valid

# Ordered List with Consistent Prefixes

1. First item
1. Second item
1. Third item