definitionUses
Reports unused reference definitions.
✅ This rule is included in the md logical preset.
In Markdown, you can define reference-style links and images using definitions that appear elsewhere in the document. When definitions are created but never referenced, they become unused and add unnecessary clutter. Unused definitions may indicate broken references or content that was intended to be included, and can mislead readers who might assume the definitions are being used somewhere.
Examples
Section titled “Examples”[mercury]: https://example.com/mercury/[venus]: https://example.com/venus.jpg[mercury]: https://example.com/mercury/
[Mercury][mercury]
[venus]: https://example.com/venus/[Mercury][mercury]
[mercury]: https://example.com/mercury/![Venus Image][venus]
[venus]: https://example.com/venus.jpgSee [docs][] and [guide][].
[docs]: https://docs.example.com[guide]: https://guide.example.com[//]: # "This is a comment 1"
[//]: <> (This is a comment 2)When Not To Use It
Section titled “When Not To Use It”If you intentionally use unused definitions as placeholders and have a framework or other workflow that always fills them in later, you might want to disable this rule.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
markdown/no-unused-definitions - Markdownlint:
link-image-reference-definitions
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.