MD054 checks for consistent use of link and image styles. Different styles include:
- Autolinks:
<https://example.com> - Inline:
[text](url)and - Full reference:
[text][ref]and![alt][ref]with[ref]: url - Collapsed reference:
[text][]and![alt][]with[text]: url - Shortcut reference:
[text]and![alt]with[text]: url - URL inline:
[https://example.com](https://example.com)(inline where text matches URL)
This rule accepts an object with the following properties:
autolink- Allow autolinks (default:true)inline- Allow inline links and images (default:true)full- Allow full reference links and images (default:true)collapsed- Allow collapsed reference links and images (default:true)shortcut- Allow shortcut reference links and images (default:true)url_inline- Allow inline links where text matches URL (default:true)
[linters.settings.link-image-style]
autolink = false # Disallow <https://example.com>
inline = true # Allow [text](url) and 
full = true # Allow [text][ref] and ![alt][ref]
collapsed = true # Allow [text][] and ![alt][]
shortcut = true # Allow [text] and ![alt]
url_inline = false # Disallow [https://example.com](https://example.com)Visit <https://example.com> for more information.Visit [our website](https://example.com) for more information.Check out [this link](https://example.com).
Check out [this link][example].
![Image description][example-image]
[example]: https://example.com
[example-image]: https://example.com/image.jpgVisit [https://example.com](https://example.com).Visit [our website](https://example.com).Different projects may prefer different link and image styles for consistency and readability. Some considerations:
- Autolinks are simple but don't allow custom text
- Inline links are readable but can make long URLs unwieldy
- Reference links keep URLs separate from text, improving readability
- URL inline links are redundant and add visual clutter
This rule allows you to enforce a consistent style across your documentation.