Registry / testing / remark-lint-rule-style

remark-lint-rule-style

JSON →
library4.0.1jsnpmunverified

A remark-lint rule to warn when thematic breaks (horizontal rules) are inconsistent. Current stable version is 4.0.1, part of the remark-lint ecosystem (ESM-only, Node 16+). Enforces a consistent style for horizontal rule markers and spacing. Key differentiator: detects the first used style automatically (`'consistent'` option) or allows explicit string like `'---'`. Works with remark-lint presets like `remark-preset-lint-consistent` and `remark-preset-lint-markdown-style-guide`.

npm install remark-lint-rule-style
INSTALL
IMPORT
SIG · REMARK-LINT-RULE-S
R
remark-lint-rule-style
testingjavascriptv4.0.1
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.

remarkLintRuleStyle
import remarkLintRuleStyle from 'remark-lint-rule-style'
const remarkLintRuleStyle = require('remark-lint-rule-style')
ESM-only since v4. CommonJS require will throw error.
Options
import type { Options } from 'remark-lint-rule-style'
import { Options } from 'remark-lint-rule-style'
Options is a type, not a runtime export. Use 'import type' for TypeScript or '// @ts-expect-error' if mistakenly imported as value.
default export (remarkLintRuleStyle)
unified().use(remarkLintRuleStyle, { style: '---' })
unified().use(remarkLintRuleStyle, '---')
Second argument should be an options object, not a plain string unless it's 'consistent'. For explicit styles, use `{ style: '---' }`.

Lint a markdown string and report warnings for inconsistent horizontal rule styles.

import { unified } from 'unified' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import remarkLint from 'remark-lint' import remarkLintRuleStyle from 'remark-lint-rule-style' import { reporter } from 'vfile-reporter' const file = await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintRuleStyle, { style: '---' }) .use(remarkStringify) .process('***\n\n---') console.error(reporter(file))
Debug
Known issues
breakingv4 dropped CommonJS support; require() will throw.
fix
Use ESM imports: import remarkLintRuleStyle from 'remark-lint-rule-style'
affects: >=4.0.0
breakingv4 requires Node 16+.
fix
Upgrade Node.js to >=16
affects: >=4.0.0
deprecatedPassing string directly as options (e.g., '---') is deprecated in v4; use object form.
fix
Use { style: '---' } instead of '---'
affects: >=4.0.0
gotchaOptions type 'consistent' is a string, not an object. { style: 'consistent' } works but can be simplified to just the string.
fix
Use 'consistent' directly: .use(remarkLintRuleStyle, 'consistent')
affects: >=1.0.0
gotchaTypeScript users may mistakenly import Options as a value; it's a type-only export.
fix
Use import type { Options } from 'remark-lint-rule-style'
affects: >=4.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using CommonJS require() on an ESM-only package.
fix
Switch to import statement: import remarkLintRuleStyle from 'remark-lint-rule-style'
TypeError: remarkLintRuleStyle is not a function
Importing default export incorrectly (e.g., using named import for default).
fix
Use default import: import remarkLintRuleStyle from 'remark-lint-rule-style'
Error: Cannot find module 'remark-lint-rule-style'
Package not installed or typo in package name.
fix
Run: npm install remark-lint-rule-style
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
unified-lint-rulerequiredcore dependency providing the lint rule interface
remark-message-controlrequiredused for message control features
@types/mdastoptionalprovides TypeScript types for mdast nodes
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-rule-style — npm install remark-lint-rule-style · libregistry