Skip to content

markdown-preferences/thematic-break-length

enforce consistent length for thematic breaks (horizontal rules) in Markdown.

  • ⚙️ 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.

📖 Rule Details

This rule ensures that all thematic breaks (e.g., ---, ***, or ___) have a consistent number of characters, improving readability and style consistency across your documentation.

md
<!-- eslint markdown-preferences/thematic-break-length: 'error' -->

<!-- ✓ GOOD -->
---
---
---

***
***
***

___
___
___

<!-- ✗ BAD -->
----
------
-----
****
******
*****
____
______
_____

🔧 Options

json
{
  "markdown-preferences/thematic-break-length": [
    "error",
    {
      "length": 3
    }
  ]
}
  • length: The desired length for all thematic breaks (default: 3).

📚 Further Reading

🚀 Version

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

🔍 Implementation