Skip to content

referenceLikeUrls

Reports resource links/images with URLs that match definition identifiers.

✅ This rule is included in the md logical preset.

When you have a definition like [mercury]: https://example.com/mercury/ in your Markdown document, using [text](mercury) as an inline link is likely a mistake. The URL mercury matches the definition identifier, suggesting you meant to use the reference syntax [text][mercury] instead. This rule helps catch these common errors where inline URLs accidentally match definition identifiers.

[**Mercury**](mercury) is the first planet from the sun.
[mercury]: https://example.com/mercury/
![**Mercury** is a planet](mercury).
[mercury]: https://example.com/mercury.jpg
[FLint](flint) is a great tool.
[flint]: https://flint.fyi

If you use a framework or separate workflow that allows definition identifiers as inline URLs, you can disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.