remark-lint-ordered-list-marker-value

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

A remark-lint rule to check the marker value of ordered lists in Markdown. Current version 4.0.1, part of the remark-lint ecosystem, released as needed. It enforces one of three styles: 'one' (all markers must be 1), 'ordered' (sequential increment), or 'single' (same as first). The default 'consistent' infers style from the first two-item list. Works with unified, ESM-only. Commonly used in lint presets like remark-preset-lint-consistent.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/remark-lint-ordered-list-marker-value/index.js from /path/to/file.js not supported.
cause Using CommonJS require() on an ESM-only package.
fix
Replace require() with import statement or use dynamic import().
error TypeError: remarkLintOrderedListMarkerValue is not a function
cause Misconfigured options or forgetting to call .use() properly.
fix
Ensure you pass the plugin function directly to unified().use(), e.g., .use(remarkLintOrderedListMarkerValue, 'ordered').
error Cannot find module 'remark-lint-ordered-list-marker-value'
cause Package not installed or resolution failed.
fix
Run npm install remark-lint-ordered-list-marker-value and ensure node_modules is accessible.
breaking ESM-only: Package does not support CommonJS require() in v4+.
fix Switch to ESM imports (import statement) or downgrade to v3 if CJS is required.
gotcha Options: The 'consistent' option infers style from the first list with two or more items; lists with single items are ignored.
fix Explicitly set style to 'one', 'ordered', or 'single' to avoid unexpected inference.
deprecated Node version: Requires Node.js 16+; older versions may not work.
fix Upgrade Node.js to 16 or later.
gotcha No CJS support: This package is ESM-only; bundlers must handle ESM.
fix Ensure your environment or bundler supports ESM.
npm install remark-lint-ordered-list-marker-value
yarn add remark-lint-ordered-list-marker-value
pnpm add remark-lint-ordered-list-marker-value

Demonstrates using remark-lint-ordered-list-marker-value with unified, parsing Markdown, linting with 'ordered' style, and outputting the result.

import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import remarkLint from 'remark-lint'
import remarkLintOrderedListMarkerValue from 'remark-lint-ordered-list-marker-value'

const processor = unified()
  .use(remarkParse)
  .use(remarkStringify)
  .use(remarkLint)
  .use(remarkLintOrderedListMarkerValue, 'ordered')

const md = '1. Item 1\n2. Item 2\n'
const result = await processor.process(md)
console.log(String(result))