remark-lint-unordered-list-marker-style

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

remark-lint rule to enforce consistent unordered list marker styles (asterisk, plus, or hyphen) in Markdown. Current stable version 4.0.1, part of the remark-lint ecosystem for linting Markdown. Ships TypeScript types. Defaults to 'consistent' (first style detected), but can be set to '*', '+', or '-'. Integrates with remark-stringify for auto-fixing. ESM-only since v4, requires Node.js 16+. Differentiators: part of the unified collective, highly configurable, and recommended by markdown style guides.

error ERR_REQUIRE_ESM
cause Using CommonJS require() on this ESM-only package.
fix
Change to import statement: import remarkLintUnorderedListMarkerStyle from 'remark-lint-unordered-list-marker-style'
error Error: Cannot find module 'remark-lint'
cause Missing peer dependency remark-lint.
fix
npm install remark-lint
error TypeError: options is not iterable
cause Passing invalid options type (e.g., array instead of string).
fix
Ensure options is one of: '*', '+', '-', or 'consistent'. Example: .use(remarkLintUnorderedListMarkerStyle, '*')
breaking Package is ESM-only since v4. Using require() will throw 'ERR_REQUIRE_ESM'.
fix Switch to import syntax and ensure Node.js 16+.
breaking Minimum Node.js version bumped to 16+ in v4.
fix Update Node.js to 16 or later.
gotcha The rule does not auto-fix; use remark-stringify configuration to set bullet style.
fix Add bullet option to remark-stringify: .use(remarkStringify, { bullet: '*' })
deprecated Option 'consistent' behaves differently: it uses the first marker found, not a global style.
fix Explicitly set intended style to avoid ambiguity.
npm install remark-lint-unordered-list-marker-style
yarn add remark-lint-unordered-list-marker-style
pnpm add remark-lint-unordered-list-marker-style

Lints an MD file enforcing asterisk markers for unordered lists, reporting any violations.

import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkLint from 'remark-lint'
import remarkStringify from 'remark-stringify'
import remarkLintUnorderedListMarkerStyle from 'remark-lint-unordered-list-marker-style'
import { reporter } from 'vfile-reporter'
import { read } from 'to-vfile'

const file = await unified()
  .use(remarkParse)
  .use(remarkLint)
  .use(remarkLintUnorderedListMarkerStyle, '*') // enforce asterisk markers
  .use(remarkStringify)
  .process(await read('example.md'))

console.error(reporter(file))