mdsmith
Esc
    v0.52.0 GitHub
    MDS043 link ready

    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

    SettingTypeDefaultDescription
    allow-footnotesboolfalseOpt back into footnotes. Numeric slugs and definitions placed away from the referencing paragraph still fail

    # Config

    Enable:

    rules:
      no-reference-style: true

    Allow footnotes when the slug is meaningful and the definition sits right after its referencing paragraph:

    rules:
      no-reference-style:
        allow-footnotes: true

    Disable:

    rules:
      no-reference-style: false

    # Examples

    # Full
    
    See [example][site] for more.
    
    [site]: https://example.com
    # 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
    # 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

    MessageMeaning
    reference-style link; use inline form ...Full, collapsed, or shortcut reference link found
    footnote reference; footnotes are not allowedA [^slug] reference appeared while allow-footnotes is false
    footnote slug is numeric; use a meaningful slugallow-footnotes is true but the slug is purely digits
    footnote reference has no matching definitionallow-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