remark-lint-definition-case

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

A remark-lint rule that warns when definition labels in Markdown are not lowercase, helping enforce consistent casing. Current stable version is 4.0.1, published as part of the remark-lint monorepo. The plugin is ESM-only, supports Node.js 16+, and is compatible with remark-lint presets like remark-preset-lint-markdown-style-guide. It works with regular definitions and GFM footnote definitions. No options are required.

error Cannot find module 'remark-lint-definition-case'
cause Missing npm install or incorrect import path.
fix
Run 'npm install remark-lint-definition-case' and ensure import path is correct.
error remarkLintDefinitionCase is not a function
cause Attempting to call the imported default export as a factory (e.g., remarkLintDefinitionCase()).
fix
Use the import directly: .use(remarkLintDefinitionCase), not .use(remarkLintDefinitionCase()).
breaking v4.0.0: Package became ESM-only; removed CommonJS support.
fix Use import syntax instead of require(). Ensure Node.js version 16+.
gotcha The rule checks definition labels (e.g., [label]: url) but does not affect reference labels (e.g., [label]) which are matched case-insensitively.
fix No action needed; this is by design. Ensure definition labels are lowercase to avoid warnings.
gotcha The rule does not accept any options; passing options will be ignored silently.
fix Do not pass options to the plugin.
npm install remark-lint-definition-case
yarn add remark-lint-definition-case
pnpm add remark-lint-definition-case

Shows how to use remark-lint-definition-case in a unified pipeline to lint a Markdown file and output messages.

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 remarkLintDefinitionCase from 'remark-lint-definition-case'

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

await unified()
  .use(remarkParse)
  .use(remarkLint)
  .use(remarkLintDefinitionCase)
  .use(remarkStringify)
  .process(file)

console.error(reporter(file))