remark-lint-list-item-style

raw JSON →
3.0.1 verified Fri May 01 auth: no javascript

A remark-lint rule that warns when list items violate a given capitalization or punctuation style. Version 3.0.1 is the current stable release, part of the unified-utils monorepo with active maintenance. It picks up where the abandoned remark-lint-list-item-punctuation left off, offering full unicode support and configurable options for checking first-letter capitalization, punctuation, and paragraph spread. Requires Node.js >=20.18.0 and is ESM-only. It is used with remark-lint to enforce consistent list item styling across Markdown documents.

error Error [ERR_REQUIRE_ESM]: require() of ES Module
cause Using CommonJS require() on an ESM-only package (v3.0.0+).
fix
Switch to import syntax or use dynamic import: const mod = await import('remark-lint-list-item-style')
error Cannot find module 'remark-lint-list-item-style'
cause Plugin name used incorrectly in remark-cli or config.
fix
In CLI, use 'lint-list-item-style'. In .remarkrc, use 'remark-lint-list-item-style' as a string or import.
error TypeError: remarkLintListItemStyle is not a function
cause Importing the wrong symbol. The package exports a default function, not a named export.
fix
Use default import: import remarkLintListItemStyle from 'remark-lint-list-item-style'
breaking Minimum supported Node.js version is now 20.18.0. Older versions are no longer supported.
fix Upgrade Node.js to >=20.18.0.
breaking Package is now ESM-only since v3.0.0. Using CommonJS require() will fail with ERR_REQUIRE_ESM.
fix Use import syntax instead of require(). If using CommonJS, consider dynamic import().
deprecated The option 'firstWord' has been renamed to 'capitalize' in some related packages; check docs for compatibility.
fix Use 'firstWord' as documented for this version; future versions may adopt 'capitalize'.
gotcha The CLI plugin name is 'lint-list-item-style', not 'remark-lint-list-item-style'. Using the full name will not be recognized.
fix Use '--use lint-list-item-style' in remark-cli.
gotcha The rule checks the first letter of bold, italic, and struck-through items correctly only since v3.0.1. Prior versions may miss these cases.
fix Upgrade to v3.0.1 or later to fix detection for formatted list items.
npm install remark-lint-list-item-style
yarn add remark-lint-list-item-style
pnpm add remark-lint-list-item-style

Shows how to use the plugin with remark to lint list items for punctuation, capitalization, and paragraph spread.

import { read } from 'to-vfile';
import { reporter } from 'vfile-reporter';
import { remark } from 'remark';
import remarkLint from 'remark-lint';
import remarkLintListItemStyle from 'remark-lint-list-item-style';

const file = await remark()
  .use(remarkLint)
  .use(remarkLintListItemStyle, { punctuation: '.', firstWord: true, spread: 'each' })
  .process(await read('example.md'));

console.log(reporter(file));