Skip to content

markdown-preferences/thematic-break-character-style

enforce consistent character style 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 enforces a consistent character style for thematic breaks (horizontal rules) in Markdown. You can specify which character (-, *, or _) should be used for thematic breaks.

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

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

<!-- ✗ BAD -->
***
___

🔧 Options

You can specify the preferred character for thematic breaks using the style option. The available values are "-", "*", and "_".

json
{
  "markdown-preferences/thematic-break-character-style": [
    "error",
    { "style": "-" }
  ]
}

If no option is specified, "-" is used by default.

📚 Further Reading

🚀 Version

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

🔍 Implementation