mdsmith
Esc
    v0.52.0 GitHub
    MDS004 heading ready

    MDS004: first-line-heading

    First line of the file should be a heading.

    # Settings

    SettingTypeDefaultDescription
    levelint1Required heading level for the first line
    placeholderslist[]Placeholder tokens to treat as opaque; see placeholder grammar

    Useful tokens: heading-question, var-token, placeholder-section.

    # Config

    Enable (default):

    rules:
      first-line-heading:
        level: 1

    Disable:

    rules:
      first-line-heading: false

    Custom (require level 2):

    rules:
      first-line-heading:
        level: 2

    # Examples

    # Bad — content before heading

    Some content here.
    
    # Title

    # Bad — blank line before heading

    The file below has a blank line between the frontmatter closing --- and # Title. The blank line is not visible in the code block but triggers the diagnostic.

    # Title

    # Good

    # Title
    
    Some content here.

    # Diagnostics

    MessageCondition
    first line should be a level {level} headingLine 1 is missing or not a heading
    first line should be a level {level} heading, found blank lineFirst child is a heading but preceded by blank line
    first heading should be level {level}, got {n}First heading on line 1 has the wrong level

    # See also

    # Meta-Information

    • ID: MDS004
    • Name: first-line-heading
    • Status: ready
    • Default: enabled, level: 1
    • Fixable: no
    • Implementation: source
    • Category: heading
    • markdownlint: MD041 (first-line-h1)
    • rumdl: MD041 (first-line-h1)
    • mado: MD041 (first-line-h1)