A remark-lint rule that warns when identifiers (footnotes, links, etc.) are defined multiple times in Markdown documents. Current stable version is 4.0.1 (ESM-only, requires Node.js 16+). Part of the remark-lint ecosystem, included in `remark-preset-lint-recommended`. It helps catch mistakes where the same identifier is used for different definitions, ensuring uniqueness. Unlike custom checks, this rule integrates seamlessly with remark's unified pipeline and provides clear, standardized error messages.
npm install remark-lint-no-duplicate-definitionsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to use the rule to detect duplicate definitions. The input has two identical identifiers (mercury) and the output will show a warning.
Use import syntax or dynamic import(). If you must use require, set type: module in package.json or use .mjs extension.
If you need to allow duplicates, consider using a custom rule or ignore messages via remark-lint options.
Ensure identifiers match exactly. If you need case-insensitive checking, use a custom rule or additional linting.
Use remark-lint-no-undefined-references to catch missing definitions, and ensure uniqueness via this rule.
Remove duplicate definitions or rename one of the identifiers to be unique.
Use `import remarkLintNoDuplicateDefinitions from 'remark-lint-no-duplicate-definitions'` (no curly braces).
Use dynamic import() or switch to ESM (e.g., set type: module in package.json).