remark-lint-list-item-indent

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

remark-lint rule (v4.0.1) to check whitespace between list item markers (including bullets and ordered list markers) and content. Part of the remark-lint ecosystem. Supports three indentation styles: 'one' (marker + 1 space), 'tab' (marker + spaces to next tab stop), and 'mixed' (tight lists as 'one', loose lists as 'tab'). Ships TypeScript types. Used in presets like remark-preset-lint-recommended (default 'one') and remark-preset-lint-markdown-style-guide (default 'mixed'). ESM-only package; requires Node.js 16+. Minimal alternative to more complex lint rules.

error require() of ES Module
cause Using CJS require with an ESM-only package
fix
Use import or switch to dynamic import.
error TypeError: (0 , remark_lint_list_item_indent_default) is not a function
cause Imported as named export instead of default
fix
Use default import: import remarkLintListItemIndent from 'remark-lint-list-item-indent'
error Cannot find module 'remark-lint'
cause Missing peer dependency remark-lint
fix
npm install remark-lint
breaking Package is ESM-only; CommonJS require is not supported.
fix Use import or dynamic import. If you need CJS, use v3.”
gotcha The rule is only a warning; it does not auto-fix. Use remark-stringify with appropriate settings for fixing.
fix Consider using remark-stringify with listItemIndent option.
deprecated The 'mixed' option may be deprecated in future versions.
fix Prefer 'one' or 'tab' explicitly.
npm install remark-lint-list-item-indent
yarn add remark-lint-list-item-indent
pnpm add remark-lint-list-item-indent

Create a unified processor with remark-lint and the list-item-indent rule to check markdown indentation style.

import remarkLint from 'remark-lint';
import remarkLintListItemIndent from 'remark-lint-list-item-indent';
import remarkParse from 'remark-parse';
import { unified } from 'unified';
import { reporter } from 'vfile-reporter';

const file = await unified()
  .use(remarkParse)
  .use(remarkLint)
  .use(remarkLintListItemIndent, 'tab') // enforce 'tab' style
  .process('* Item\n\n1.  Item');

console.error(reporter(file));