markdown-preferences/definitions-last
require link definitions and footnote definitions to be placed at the end of the document
- 🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
📖 Rule Details
This rule requires link definitions ([label]: URL
) and footnote definitions ([^label]: text
) to be placed at the end of the document, after all other content.
md
<!-- eslint markdown-preferences/definitions-last: 'error' -->
<!-- ✗ BAD -->
# Document Title
[link]: https://example.com
This content comes after a link definition.
[^note]: This footnote definition is too early.
More content here with [link] and footnote[^note].
<!-- ✓ GOOD -->
# Document Title
This is some content with [link] references and footnotes[^note].
## Section
More content here.
[link]: https://example.com
[^note]: This is a footnote definition.
🔧 Options
This rule has no options.
📚 Further Reading
👫 Related Rules
- markdown-preferences/prefer-link-reference-definitions - enforce using link reference definitions
🚀 Version
This rule was introduced in eslint-plugin-markdown-preferences v0.7.0