Registry / testing / remark-lint-list-item-spacing

remark-lint-list-item-spacing

JSON →
library5.0.1jsnpmunverified

remark-lint rule to warn when lists violate a given style regarding blank lines between list items. Current stable version 5.0.1 is ESM-only and ships TypeScript types. Part of the remark-lint collection, it enforces consistent tight/loose list formatting based on options. Differentiators: defaults to markdown-style-guide preferences, supports custom checkBlanks option. Released as part of remark-lint monorepo with frequent updates; compatible with unified ecosystem.

npm install remark-lint-list-item-spacing
INSTALL
IMPORT
SIG · REMARK-LINT-LIST-I
R
remark-lint-list-item-spacing
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.

remarkLintListItemSpacing
import remarkLintListItemSpacing from 'remark-lint-list-item-spacing'
const remarkLintListItemSpacing = require('remark-lint-list-item-spacing')
ESM-only package since v5, cannot use require(). Default export.
Options
import type { Options } from 'remark-lint-list-item-spacing'
import { Options } from 'remark-lint-list-item-spacing'
Options is a TypeScript type export, not a runtime value. Use type-only import.
remark-lint plugin usage
.use(remarkLint).use(remarkLintListItemSpacing, { checkBlanks: true })
.use(remarkLintListItemSpacing)
The plugin must be used after remarkLint in the unified pipeline. Options object is optional.

Sets up unified pipeline with remark-lint and list-item-spacing rule, processes a markdown file and reports lint warnings.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkLint from 'remark-lint'; import remarkLintListItemSpacing from 'remark-lint-list-item-spacing'; import { reporter } from 'vfile-reporter'; import { read } from 'to-vfile'; const file = await read('example.md'); await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintListItemSpacing, { checkBlanks: true }) .use(remarkStringify) .process(file); console.error(reporter(file));
remark --version
Debug
Known issues
breakingPackage is ESM-only since v5. Requires Node.js 16+ and cannot be required with CommonJS.
fix
Use import syntax or update to a bundler that supports ESM.
affects: >=5.0.0
gotchaThe rule must be used after remarkLint in the unified plugins array, otherwise it won't work.
fix
Ensure .use(remarkLint) is called before .use(remarkLintListItemSpacing).
affects: >=1.0.0
gotchaThe default behavior expects blank lines between items only when items span multiple lines, not when they contain blank lines internally. This can cause unexpected warnings.
fix
Set checkBlanks: true to check blank lines based on internal blank lines instead.
affects: <5.0.0
deprecatedThe rule previously accepted a boolean option to enable/disable checking blank lines; in v5 this was replaced with the options object.
fix
Update to use object syntax: .use(remarkLintListItemSpacing, { checkBlanks: true })
affects: <5.0.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-list-item-spacing'
Package not installed or version mismatch.
fix
Run 'npm install remark-lint-list-item-spacing' or ensure it is in package.json.
SyntaxError: Unexpected token 'export'
Using CommonJS require() with ESM-only package.
fix
Use dynamic import() or switch to ESM: 'import remarkLintListItemSpacing from "remark-lint-list-item-spacing"'
TypeError: (0 , remarkLint) is not a function
Package possibly imported incorrectly (default vs named export).
fix
Ensure correct import: import remarkLint from 'remark-lint' (default export).
Upgrade
Version history
5.0.1latest on npm
Audit
Dependencies
remark-lintrequiredrequired peer dependency for lint rule integration
unifiedoptionalneeded to process markdown with unified pipeline
remark-parseoptionalneeded for markdown parsing in unified pipeline
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-list-item-spacing — npm install remark-lint-list-item-spacing · libregistry