Catalog npm
PACKAGE EXPLORERView in registry

@0x6b/textlint-rule-no-hr-before-heading

npm

textlint rule which detects horizontal rules appearing immediately before headings.

headinghorizontal-rulemarkdowntextlintrule
Versions collected1
Direct dependencies9From release 0.1.0
Last observed20 Oct, 22:38 UTC

README

Current package documentation

textlint-rule-no-hr-before-heading

textlint rule which detects and reports horizontal rules appearing immediately before headings in your markdown document.

While horizontal rules (---, ***, ___) before headings are syntactically valid in Markdown, they often create visual clutter. Markdown headings already provide clear visual separation, making horizontal rules redundant in this context.

Install

Install with pnpm:

pnpm add @0x6b/textlint-rule-no-hr-before-heading

Or with npm:

npm install @0x6b/textlint-rule-no-hr-before-heading

This module requires Node.js >= 20.0.0.

Usage

Via .textlintrc(recommended):

{
  "rules": {
    "@0x6b/no-hr-before-heading": true
  }
}

Via CLI:

textlint --rule @0x6b/no-hr-before-heading README.md

Examples

Invalid

---

# Heading

Some content

___

## Another Heading

Valid

# Heading

Some content

---

More content

## Another Heading

Fixable

This rule is automatically fixable using the --fix option. The horizontal rule and any whitespace between it and the heading will be removed.

Front Matter Support

This rule correctly handles YAML front matter in Markdown files. Front matter delimiters (---) are not treated as horizontal rules when properly formatted:

---
title: My Document
date: 2023-01-01
---

# Heading

This is valid and will not trigger the rule because textlint's markdown parser includes remark-frontmatter support by default, which correctly parses front matter as a special node type rather than as horizontal rules.

Build

Builds source codes for publish to the lib/ folder.

pnpm install && pnpm run build

Test

Run test code in test folder by textlint-tester.

pnpm test

References

License

MIT © 0x6b

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.0Registry latest6 Nov 20259

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
0x6b/textlint-rule-no-hr-before-heading

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:38 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:6f656de81d46595401d5a13b2a935af2372224707275bf93746e6c65743e2c75