Registry / testing / remark-lint-no-hr-after-heading

remark-lint-no-hr-after-heading

JSON →
library1.0.0jsnpmunverified

A remark-lint rule that warns when a horizontal rule (thematic break) appears immediately after a heading. This package is version 1.0.0, released as a stable linting rule for the remark ecosystem. It helps enforce stylistic consistency by discouraging the use of `---` as a heading border. Unlike general heading styles, this rule specifically targets thematic breaks placed after headings. The rule is part of the remark-lint plugin collection and integrates seamlessly with remark's CLI, API, and configuration files.

npm install remark-lint-no-hr-after-heading
INSTALL
IMPORT
SIG · REMARK-LINT-NO-HR-
R
remark-lint-no-hr-after-heading
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const remarkLintNoHrAfterHeading = require('remark-lint-no-hr-after-heading')
CommonJS import for Node.js; the package does not export named symbols.
default
import remarkLintNoHrAfterHeading from 'remark-lint-no-hr-after-heading'
import { remarkLintNoHrAfterHeading } from 'remark-lint-no-hr-after-heading'
This package uses default export, not named export. Named import will result in undefined.
plugin
.use(require('remark-lint-no-hr-after-heading'))
.use(require('remark-lint-no-hr-after-heading').default)
When using with unified/remark, pass the module directly; the plugin is the default export.

Demonstrates how to use remark-lint-no-hr-after-heading with remark, including lint and reporter.

// Example using remark with lint and this rule const remark = require('remark') const lint = require('remark-lint') const noHrAfterHeading = require('remark-lint-no-hr-after-heading') const report = require('vfile-reporter') remark() .use(lint) .use(noHrAfterHeading) .process('# Hello World\n---', (err, file) => { console.error(report(err || file)) }) // Output: warning: Don’t use a horizontal line after a heading
remark --version
Debug
Known issues
gotchaThe package name is 'remark-lint-no-hr-after-heading', but README examples show incorrect install names like 'remark-lint-no-heading-indent' and 'lint-no-hr-after-indent'. Ensure you use the correct package name.
fix
Install the correct package: npm install remark-lint-no-hr-after-heading
affects: >=1.0.0
gotchaThis rule must be used together with the 'remark-lint' base plugin. Using it alone will have no effect.
fix
Add remark-lint as a dependency and use it before this rule: .use(lint).use(noHrAfterHeading)
affects: >=1.0.0
gotchaThe module uses CommonJS exports and may not have ESM compatibility. Using dynamic import may require special handling in ESM environments.
fix
Use require() or if using ESM, use createRequire from 'module'.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-no-hr-after-heading'
Package not installed
fix
npm install remark-lint-no-hr-after-heading
TypeError: remark().use(...) is not a function
Forgetting to call .use() with lint first
fix
Ensure you call .use(lint) before .use(noHrAfterHeading)
Warning: Ignored unknown rule: no-hr-after-heading
Using the rule without the remark-lint plugin
fix
Add remark-lint to your plugins list and use it before this rule
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
remark-lintrequiredRequired to be installed alongside as a base linting plugin
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-no-hr-after-heading — npm install remark-lint-no-hr-after-heading · libregistry