Skip to content

markdown-preferences/ordered-list-marker-start

enforce that ordered list markers start with 1 or 0

  • ⚙️ This rule is included in plugin.configs.standard.
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.
  • 💡 Some problems reported by this rule are manually fixable by editor suggestions.

📖 Rule Details

This rule enforces that ordered lists in Markdown start with a specific number (1 or 0). It helps ensure consistency in documentation and prevents accidental mistakes in list numbering.

md
<!-- eslint markdown-preferences/ordered-list-marker-start: 'error' -->

<!-- ✓ GOOD -->

1. foo
2. bar
3. baz

<!-- ✗ BAD -->

0. foo
1. bar 2. baz

If you want to allow lists to start with 0, use the option { "start": 0 }:

md
<!-- eslint markdown-preferences/ordered-list-marker-start: ["error", {"start":0}] -->

<!-- ✓ GOOD -->

0. foo
1. bar
2. baz

<!-- ✗ BAD -->

1. foo
2. bar 3. baz

🔧 Options

json
{
  "markdown-preferences/ordered-list-marker-start": [
    "error",
    {
      "start": 1
    }
  ]
}
  • start ... Enforces that ordered lists must start with the specified value (0 or 1). If set to 1, lists must start with 1.. If set to 0, lists must start with 0.. Defaults to 1.

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-markdown-preferences v0.12.0

🔍 Implementation