remark-lint-ordered-list-marker-style

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

A remark-lint rule (v4.0.1, ESM-only, TypeScript typed) that warns when ordered list markers in Markdown violate a configured style (dot or parenthesis). Part of the remark-lint ecosystem, it supports detecting the first style used and flagging inconsistencies. Released as part of remark-lint monorepo with consistent versioning; compatible with Node.js 16+ and integrates with unified ecosystem. Differentiators: built-in fix support, preset inclusion (consistent, markdown-style-guide, recommended), and no runtime dependencies beyond remark-lint peer.

error Cannot find module 'remark-lint-ordered-list-marker-style'
cause Package not installed or wrong import path.
fix
Run npm install remark-lint-ordered-list-marker-style and verify that your import uses the correct ESM syntax.
error Invalid option value: must be a string
cause Passing a non-string option (e.g., `true` or an object) to the plugin.
fix
Use one of the valid styles: '.', ')', or 'consistent'.
error TypeError: remarkLintOrderedListMarkerStyle is not a function
cause Using CommonJS `require()` to import the package, which is ESM-only.
fix
Use import syntax or use dynamic import() for CommonJS modules.
error Cannot use import statement outside a module
cause Missing `"type": "module"` in package.json or using `.js` instead of `.mjs`.
fix
Add "type": "module" to your package.json or rename file to .mjs.
breaking v3 dropped CommonJS support; package is ESM-only.
fix Use `import` syntax instead of `require()`. Set `"type": "module"` in package.json or use `.mjs` extension.
breaking v4 requires Node.js 16+; older versions of Node.js are no longer supported.
fix Upgrade Node.js to version 16 or later.
deprecated The `options` parameter default changed from `'consistent'` to `'consistent'` — no functional change, but always explicitly set options for clarity.
fix Pass options explicitly: `.use(remarkLintOrderedListMarkerStyle, '.')`.
gotcha The rule only checks the marker character (`.` vs `)`), not numbering sequence order or starting value.
fix Use additional rules like `remark-lint-ordered-list-marker-value` for numbering sequence checks.
gotcha When using `'consistent'` option, the first ordered list marker style in the document sets the expected style; mixing styles will warn.
fix Define a fixed style (e.g., `'.'` or `')'`) to avoid ambiguity.
deprecated The rule previously accepted `'dot'` and `'paren'` as string styles; these were removed in v1.
fix Use `'.'` or `')'` directly.
npm install remark-lint-ordered-list-marker-style
yarn add remark-lint-ordered-list-marker-style
pnpm add remark-lint-ordered-list-marker-style

Shows how to parse Markdown, lint ordered list markers with dot style, and process output.

import {unified} from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintOrderedListMarkerStyle from 'remark-lint-ordered-list-marker-style';

const processor = unified()
  .use(remarkParse)
  .use(remarkStringify)
  .use(remarkLint)
  .use(remarkLintOrderedListMarkerStyle, '.'); // Enforce dot style

const md = '1. Item\n2) Item';
const file = await processor.process(md);
console.log(String(file));
// Output includes warning about second marker