remark-lint-list-item-bullet-indent

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

remark-lint rule to warn when list item markers (bullets or numbers) are indented. The current stable version is 5.0.1, released as part of the remark-lint monorepo with regular updates. It enforces that list items start at column 1, preventing uncommon and hard-to-maintain indented list styles. Key differentiator: it only checks indentation of the marker itself, not content indentation, and is included in the `remark-preset-lint-recommended` preset. It is ESM-only, supports Node.js 16+, and ships TypeScript types.

error Cannot find module 'remark-lint-list-item-bullet-indent'
cause Package not installed or not accessible in node_modules.
fix
Run npm install remark-lint-list-item-bullet-indent (or equivalent for yarn/pnpm).
error TypeError: remarkLintListItemBulletIndent is not a function
cause Using require() on an ESM-only version (>=5.0.0).
fix
Use import remarkLintListItemBulletIndent from 'remark-lint-list-item-bullet-indent' or downgrade to version 4.
error Error: Cannot use import statement outside a module
cause Running ESM code in a CommonJS file or environment without type: module.
fix
Either rename file to .mjs, add "type": "module" to package.json, or use dynamic import().
error Unexpected `2` spaces before list item, expected `0` spaces, remove them
cause A list item marker is indented by spaces where the rule expects zero indent.
fix
Remove leading spaces before the marker (e.g., * Item* Item).
error SyntaxError: Unexpected token 'export'
cause Using older Node.js (e.g., Node 14) with ESM-only package.
fix
Upgrade Node.js to version 16+ or use the CJS-compatible version 4.x.
breaking Version 3.0.0 dropped support for Node.js < 12.
fix Upgrade to Node.js 12+ and use remark-lint-list-item-bullet-indent@3+.
breaking Version 5.0.0 became ESM-only; CJS require() no longer works.
fix Switch to ESM imports: use `import` instead of `require()`. If using CommonJS, consider dynamic import or stick with version 4.
deprecated Version 4.x was a transitional ESM/CJS hybrid; using require() with it triggered deprecation warnings.
fix Use `import` or upgrade to 5.x pure ESM.
gotcha The rule reports the number of spaces indented; it does not allow configuration of the expected indent count.
fix If you need to allow a specific indent (e.g., 2 spaces for nested list), this rule is not suitable; consider a custom plugin.
gotcha The rule applies to both ordered and unordered list markers, including task list items (`- [ ]`).
fix Ensure your task list items also start at column 0.
gotcha The plugin must be used after `remarkLint` in the unified pipeline; otherwise, messages may not be captured.
fix Always place `.use(remarkLint)` before this rule.
gotcha When using with remark-cli, the rule name in config must match the npm package name exactly.
fix Add `'remark-lint-list-item-bullet-indent'` to the plugins array, not a shorthand.
npm install remark-lint-list-item-bullet-indent
yarn add remark-lint-list-item-bullet-indent
pnpm add remark-lint-list-item-bullet-indent

Shows how to integrate remark-lint-list-item-bullet-indent into a unified pipeline to lint a Markdown file for indented list markers.

import { read } from 'to-vfile';
import { reporter } from 'vfile-reporter';
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintListItemBulletIndent from 'remark-lint-list-item-bullet-indent';

const file = await read('example.md');

await unified()
  .use(remarkParse)
  .use(remarkStringify)
  .use(remarkLint)
  .use(remarkLintListItemBulletIndent)
  .process(file);

console.error(reporter(file));