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.
Common errors
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()).
Warnings
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.
Install
npm install remark-lint-definition-case yarn add remark-lint-definition-case pnpm add remark-lint-definition-case Imports
- remarkLintDefinitionCase wrong
const remarkLintDefinitionCase = require('remark-lint-definition-case')correctimport remarkLintDefinitionCase from 'remark-lint-definition-case' - default export wrong
import { remarkLintDefinitionCase } from 'remark-lint-definition-case'correctimport remarkLintDefinitionCase from 'remark-lint-definition-case' - unified .use() wrong
.use(remarkLintDefinitionCase())correct.use(remarkLintDefinitionCase)
Quickstart
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))