{"_id":"@0x6b/textlint-rule-no-hr-before-heading","name":"@0x6b/textlint-rule-no-hr-before-heading","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@0x6b/textlint-rule-no-hr-before-heading","version":"0.1.0","description":"textlint rule which detects horizontal rules appearing immediately before headings.","publishConfig":{"access":"public"},"keywords":["textlintrule","horizontal-rule","heading","markdown"],"homepage":"https://github.com/0x6b/textlint-rule-no-hr-before-heading","bugs":{"url":"https://github.com/0x6b/textlint-rule-no-hr-before-heading/issues"},"license":"MIT","author":{"name":"0x6b"},"main":"lib/index.js","directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/0x6b/textlint-rule-no-hr-before-heading.git"},"scripts":{"build":"textlint-scripts build","precommit":"lint-staged","postcommit":"git reset","prepublish":"pnpm run build","test":"textlint-scripts test","format":"biome check --write .","watch":"textlint-scripts build --watch"},"dependencies":{},"devDependencies":{"@biomejs/biome":"^1.9.4","@textlint/types":"^15.2.3","@types/node":"^24.7.2","husky":"^9.1.7","lint-staged":"^16.2.4","textlint-scripts":"^15.2.3","textlint-tester":"^15.2.3","ts-node":"^10.9.2","typescript":"^5.9.3"},"engines":{"node":">=20.0.0"},"lint-staged":{"*.{js,jsx,ts,tsx,json}":["git stash --keep-index","biome check --write --no-errors-on-unmatched","git stash pop"]},"gitHead":"7bbaf5041c7034c30ec4e24405fb8dc13001ecf0","_id":"@0x6b/textlint-rule-no-hr-before-heading@0.1.0","_nodeVersion":"25.0.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-p9YX6zEcmNrEk04gEn4o8GFdh2lMk0gCcfKjfwusdTJPbBormnw5MwzWVKGQc+NCKWCfLnqPNtuj+xc1F8UsPQ==","shasum":"086cd46eb6186820763862e426addfafa8fd6a48","tarball":"https://registry.npmjs.org/@0x6b/textlint-rule-no-hr-before-heading/-/textlint-rule-no-hr-before-heading-0.1.0.tgz","fileCount":5,"unpackedSize":10565,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE9oVmxBW8pH98riOQku/BB6eOdU/1mNZ3g5y4QY6DPQAiBfYUvGz3WynUWgB3trox2JKK5kmtxg5IFFCUpRTlgDoA=="}]},"_npmUser":{"name":"0x6b","email":"npm_mytidhfqd7ncqnr73yfj@warpnine.io"},"maintainers":[{"name":"0x6b","email":"npm_mytidhfqd7ncqnr73yfj@warpnine.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/textlint-rule-no-hr-before-heading_0.1.0_1762423883145_0.6033144135766657"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-06T10:11:23.030Z","0.1.0":"2025-11-06T10:11:23.348Z","modified":"2025-11-06T10:11:23.654Z"},"maintainers":[{"name":"0x6b","email":"npm_mytidhfqd7ncqnr73yfj@warpnine.io"}],"description":"textlint rule which detects horizontal rules appearing immediately before headings.","homepage":"https://github.com/0x6b/textlint-rule-no-hr-before-heading","keywords":["textlintrule","horizontal-rule","heading","markdown"],"repository":{"type":"git","url":"git+https://github.com/0x6b/textlint-rule-no-hr-before-heading.git"},"author":{"name":"0x6b"},"bugs":{"url":"https://github.com/0x6b/textlint-rule-no-hr-before-heading/issues"},"license":"MIT","readme":"# textlint-rule-no-hr-before-heading\n\n[textlint](https://textlint.github.io/) rule which detects and reports horizontal rules appearing immediately before headings in your markdown document.\n\nWhile 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.\n\n## Install\n\nInstall with [pnpm](https://pnpm.io/):\n\n```sh\npnpm add @0x6b/textlint-rule-no-hr-before-heading\n```\n\nOr with npm:\n\n```sh\nnpm install @0x6b/textlint-rule-no-hr-before-heading\n```\n\nThis module requires Node.js >= 20.0.0.\n\n## Usage\n\nVia `.textlintrc`(recommended):\n\n```json\n{\n  \"rules\": {\n    \"@0x6b/no-hr-before-heading\": true\n  }\n}\n```\n\nVia CLI:\n\n```\ntextlint --rule @0x6b/no-hr-before-heading README.md\n```\n\n## Examples\n\n### Invalid\n\n```markdown\n---\n\n# Heading\n\nSome content\n\n___\n\n## Another Heading\n```\n\n### Valid\n\n```markdown\n# Heading\n\nSome content\n\n---\n\nMore content\n\n## Another Heading\n```\n\n## Fixable\n\nThis rule is automatically fixable using the `--fix` option. The horizontal rule and any whitespace between it and the heading will be removed.\n\n## Front Matter Support\n\nThis rule correctly handles YAML front matter in Markdown files. Front matter delimiters (`---`) are not treated as horizontal rules when properly formatted:\n\n```markdown\n---\ntitle: My Document\ndate: 2023-01-01\n---\n\n# Heading\n```\n\nThis 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.\n\n## Build\n\nBuilds source codes for publish to the `lib/` folder.\n\n```sh\npnpm install && pnpm run build\n```\n\n## Test\n\nRun test code in `test` folder by [textlint-tester](https://github.com/textlint/textlint-tester \"textlint-tester\").\n\n```sh\npnpm test\n```\n\n## References\n\n- [Creating textlint rules](https://textlint.github.io/docs/rule.html)\n- [Markdown AST](https://github.com/textlint/textlint/blob/master/docs/txtnode.md)\n- [remark-frontmatter](https://github.com/remarkjs/remark-frontmatter)\n\n## License\n\nMIT © 0x6b\n","readmeFilename":"README.md","_rev":"1-30d472167b22ad7a1b56889093d750cd"}