{"id":26243,"library":"remark-lint-no-consecutive-blank-lines","title":"remark-lint-no-consecutive-blank-lines","description":"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.","status":"active","version":"5.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","blank","lines","lint","remark","remark-lint","remark-lint-rule","rule","typescript"],"install":[{"cmd":"npm install remark-lint-no-consecutive-blank-lines","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-consecutive-blank-lines","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-consecutive-blank-lines","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"RemarkLintNoConsecutiveBlankLines is a unified plugin (Transformer).","package":"unified","optional":false},{"reason":"The rule is used as part of remark-lint; remark-lint must be included in the unified pipeline.","package":"remark-lint","optional":false}],"imports":[{"note":"This package is ESM-only. CommonJS require() is not supported.","wrong":"const remarkLintNoConsecutiveBlankLines = require('remark-lint-no-consecutive-blank-lines')","symbol":"remarkLintNoConsecutiveBlankLines","correct":"import remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines'"},{"note":"The package exports a single default export, not a named export.","wrong":"import { remarkLintNoConsecutiveBlankLines } from 'remark-lint-no-consecutive-blank-lines'","symbol":"remarkLintNoConsecutiveBlankLines","correct":"import remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines'"},{"note":"This rule has no options, so there is no Options type to import.","wrong":"import type { Options } from 'remark-lint-no-consecutive-blank-lines'","symbol":"Type definitions","correct":"// No explicit type import needed; types are shiped with the package"}],"quickstart":{"code":"import remarkLint from 'remark-lint';\nimport remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport { unified } from 'unified';\nimport { reporter } from 'vfile-reporter';\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoConsecutiveBlankLines)\n  .use(remarkStringify)\n  .process('# Hello\\n\\n\\nWorld'); // Three blank lines after heading\n\nconsole.error(reporter(file));\n// Output:\n//   4:1: Unexpected `2` blank lines before node, expected up to `1` blank line, remove `1` blank line","lang":"typescript","description":"Shows how to import and use the remark-lint rule to detect too many consecutive blank lines."},"warnings":[{"fix":"Use import instead of require() and ensure Node.js version >=16.","message":"Package is ESM-only since v5; requires Node.js 16+ and cannot be used with CommonJS require().","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Always include remarkParse, remarkLint, and optionally remarkStringify in the pipeline.","message":"The rule must be used after remarkParse and remarkLint in the unified pipeline, and cannot be used standalone.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade to v5 and switch to ESM import style.","message":"Older versions (v4 and earlier) used a different default export name or required a different import pattern.","severity":"deprecated","affected_versions":"<5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import statement or set \"type\": \"module\" in package.json.","cause":"Using CommonJS require() on an ESM-only package.","error":"require() of ES Module /path/to/node_modules/remark-lint-no-consecutive-blank-lines/index.js from /path/to/file.js not supported."},{"fix":"Run npm install remark-lint-no-consecutive-blank-lines.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'remark-lint-no-consecutive-blank-lines'"},{"fix":"Use import remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines' (no curly braces).","cause":"Importing as named export instead of default export.","error":"TypeError: remarkLintNoConsecutiveBlankLines is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}