MDS043: no-reference-style
Reference-style links and footnotes require global definition resolution; flag them in favor of inline links.
Inline links ([text](url)) carry their target locally. Reference
links ([text][id] plus [id]: url) and footnotes ([^slug] plus
[^slug]: ...) require a second pass over the document to resolve.
Forbidding them keeps every link diff readable in isolation.
# Settings
| Setting | Type | Default | Description |
|---|---|---|---|
allow-footnotes | bool | false | Opt back into footnotes. Numeric slugs and definitions placed away from the referencing paragraph still fail |
# Config
Enable:
rules:
no-reference-style: trueAllow footnotes when the slug is meaningful and the definition sits right after its referencing paragraph:
rules:
no-reference-style:
allow-footnotes: trueDisable:
rules:
no-reference-style: false# Examples
# Bad – full reference link
# Full
See [example][site] for more.
[site]: https://example.com# Bad – shortcut reference link
# Shortcut
See [example] for more.
[example]: https://example.com# Bad – footnote (default)
# Footnote
A claim here.[^1]
[^1]: A note.# Bad – unused reference definition
# Unused
Some plain prose with no links.
[orphan]: https://example.com# Good – inline links
# Inline Links
See [example](https://example.com) for more.
Also see [home](https://example.org) for the project page.# Good – footnote when allowed
# Footnotes Allowed
A claim with a citation.[^source]
[^source]: Author, "Title", 2024.# Diagnostics
| Message | Meaning |
|---|---|
reference-style link; use inline form ... | Full, collapsed, or shortcut reference link found |
footnote reference; footnotes are not allowed | A [^slug] reference appeared while allow-footnotes is false |
footnote slug is numeric; use a meaningful slug | allow-footnotes is true but the slug is purely digits |
footnote reference has no matching definition | allow-footnotes is true and no [^slug]: definition exists |
footnote definition must follow ... | allow-footnotes is true but the definition is not adjacent to the ref |
unused reference definition: [id] | A reference definition has no matching link in the file |
# Meta-Information
- ID: MDS043
- Name:
no-reference-style - Status: ready
- Default: disabled, opt-in
- Fixable: yes (reference links only; footnotes are not auto-fixed)
- Implementation: source
- Category: link