Registry / testing / remark-lint-no-consecutive-blank-lines

remark-lint-no-consecutive-blank-lines

JSON →
library5.0.1jsnpmunverified

A remark-lint rule to warn when multiple blank lines (more than one consecutive blank line) are used in Markdown documents. Version 5.0.1 is the current stable release. It is part of the remark-lint ecosystem and is included in the remark-preset-lint-markdown-style-guide preset. This package is ESM-only (requires Node.js 16+) and ships TypeScript types. Unlike formatters, this tool only lints and does not automatically fix consecutive blank lines.

npm install remark-lint-no-consecutive-blank-lines
INSTALL
IMPORT
SIG · REMARK-LINT-NO-CON
R
remark-lint-no-consecutive-blank-lines
testingjavascriptv5.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.

remarkLintNoConsecutiveBlankLines
import remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines'
const remarkLintNoConsecutiveBlankLines = require('remark-lint-no-consecutive-blank-lines')
This package is ESM-only. CommonJS require() is not supported.
remarkLintNoConsecutiveBlankLines
import remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines'
import { remarkLintNoConsecutiveBlankLines } from 'remark-lint-no-consecutive-blank-lines'
The package exports a single default export, not a named export.
Type definitions
// No explicit type import needed; types are shiped with the package
import type { Options } from 'remark-lint-no-consecutive-blank-lines'
This rule has no options, so there is no Options type to import.

Shows how to import and use the remark-lint rule to detect too many consecutive blank lines.

import remarkLint from 'remark-lint'; import remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import { unified } from 'unified'; import { reporter } from 'vfile-reporter'; const file = await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoConsecutiveBlankLines) .use(remarkStringify) .process('# Hello\n\n\nWorld'); // Three blank lines after heading console.error(reporter(file)); // Output: // 4:1: Unexpected `2` blank lines before node, expected up to `1` blank line, remove `1` blank line
Debug
Known issues
breakingPackage is ESM-only since v5; requires Node.js 16+ and cannot be used with CommonJS require().
fix
Use import instead of require() and ensure Node.js version >=16.
affects: >=5.0.0
gotchaThe rule must be used after remarkParse and remarkLint in the unified pipeline, and cannot be used standalone.
fix
Always include remarkParse, remarkLint, and optionally remarkStringify in the pipeline.
affects: >=1.0.0
deprecatedOlder versions (v4 and earlier) used a different default export name or required a different import pattern.
fix
Upgrade to v5 and switch to ESM import style.
affects: <5.0.0
Errors
Common errors & fixes
require() of ES Module /path/to/node_modules/remark-lint-no-consecutive-blank-lines/index.js from /path/to/file.js not supported.
Using CommonJS require() on an ESM-only package.
fix
Change to import statement or set "type": "module" in package.json.
Error: Cannot find module 'remark-lint-no-consecutive-blank-lines'
Package not installed or not in node_modules.
fix
Run npm install remark-lint-no-consecutive-blank-lines.
TypeError: remarkLintNoConsecutiveBlankLines is not a function
Importing as named export instead of default export.
fix
Use import remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines' (no curly braces).
Upgrade
Version history
5.0.1latest on npm
Audit
Dependencies
unifiedrequiredRemarkLintNoConsecutiveBlankLines is a unified plugin (Transformer).
remark-lintrequiredThe rule is used as part of remark-lint; remark-lint must be included in the unified pipeline.
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-no-consecutive-blank-lines — npm install remark-lint-no-consecutive-blank-lines · libregistry