Markdown rules check the structure and formatting of a file: headings, lists, links, images, tables, code fences, and whitespace. Recheck ports every built-in markdownlint rule and adds a few of its own. The recheck/markdown preset turns the 53 ported rules on at error.
A Markdown rule is configured under its key in the recheck block. The key of a preset rule is recheck/<rule>, and the rule's options go under the assertion of the same name:
Options go under the assertion with the rule's name. A rule not listed here has no options. An option name a rule does not recognize is ignored without a warning.
blanks-around-fences
Option
Type
Default
Description
listItems
boolean
true
Also require blank lines around fences inside list items.
blanks-around-headings
Option
Type
Default
Description
linesAbove
number
1
Blank lines required above a heading.
linesBelow
number
1
Blank lines required below a heading.
includeFrontMatter
boolean
false
Require a blank line between front matter and a heading.
consistent uses the first style found in the file. The other values name one style, for example fenced, backtick, asterisk, underscore, atx, dash, leading_and_trailing, or sublist.
The accepted names match markdownlint's options for the rule with the same id.
descriptive-link-text
Option
Type
Default
Description
prohibitedTexts
[string]
['click here', 'here', 'link', 'more']
Link texts that are reported.
fenced-code-language
Option
Type
Default
Description
allowedLanguages
[string]
[]
When set, only these languages are allowed.
languageOnly
boolean
false
Report an info string that carries more than the language.
first-line-h1, single-h1, heading-increment
Option
Type
Default
Description
frontMatterTitle
string
^\s*"?title"?\s*[:=]
A regex. Front matter that matches it counts as the top-level heading. Set '' to ignore front matter.
level
number
1
first-line-h1 and single-h1 only: the heading level that counts as the title.
allowPreamble
boolean
false
first-line-h1 only: allow content before the first heading.
line-length
Option
Type
Default
Description
lineLength
number
80
Maximum line length.
headingLineLength
number
Maximum length of heading lines. Falls back to lineLength.
codeBlockLineLength
number
Maximum length of lines in code blocks. Falls back to lineLength.
codeBlocks
boolean
true
Check code blocks.
tables
boolean
true
Check tables.
headings
boolean
true
Check headings.
strict
boolean
false
Report long lines even when they hold no whitespace to break at.
stern
boolean
false
Report long lines that could be broken, allow the rest.
link-fragments
Option
Type
Default
Description
ignoreCase
boolean
false
Match fragments without regard to case.
ignoredPattern
string
''
A regex. Fragments that match it are not checked.
crossFile
boolean
false
Also check links and images to other files. See Cross-file links.
rootDir
string or object
''
With crossFile, the folder that site-root links such as /guides/intro resolve against. An object maps a source folder prefix to its root for monorepos; the longest matching prefix wins.
ignoredTargets
[string]
[]
With crossFile, destination globs that are not checked, for routes a site generates from data.
Cross-file links
With crossFile: true, the rule replaces an external link checker for links inside the repository:
A relative link or image target must exist on disk.
A file.md#anchor fragment must exist in the target file's headings and anchors.
Extensionless links resolve the way the Realm router does: ./page tries page.md, and a folder link reads its index.md.
Site-root links such as /x/y resolve against rootDir, and are skipped without it.
Links to <details> sections resolve, with the id derived from the <summary> text when none is set.
Markdoc tags in a heading do not change its anchor.
Spaces after a bullet in a list of single-line items.
olSingle
number
1
Spaces after a number in a list of single-line items.
ulMulti
number
1
Spaces after a bullet in a list with multi-line items.
olMulti
number
1
Spaces after a number in a list with multi-line items.
no-duplicate-heading
Option
Type
Default
Description
siblingsOnly
boolean
false
Report duplicates only among headings with the same parent.
respectSections
boolean
false
Report duplicates only inside the same section. A Recheck extension.
caseSensitive
boolean
true
Compare heading text with regard to case. A Recheck extension.
ignoreCommonHeadings
boolean
false
Skip common headings such as "Overview", "Examples", and "Troubleshooting". A Recheck extension.
no-emphasis-as-heading, no-trailing-punctuation
Option
Type
Default
Description
punctuation
string
.,;:!?。,;:!? for no-emphasis-as-heading, the same without ? and ? for no-trailing-punctuation
The characters that count as punctuation.
no-hard-tabs
Option
Type
Default
Description
codeBlocks
boolean
true
Check code blocks.
ignoreCodeLanguages
[string]
[]
Code block languages that may contain tabs.
spacesPerTab
number
1
Spaces that replace each tab with --fix.
no-inline-html
Option
Type
Default
Description
allowedElements
[string]
[]
HTML elements that are allowed.
tableAllowedElements
[string]
[]
HTML elements that are allowed inside tables.
no-multiple-blanks
Option
Type
Default
Description
maximum
number
1
Consecutive blank lines allowed.
no-multiple-space-blockquote
Option
Type
Default
Description
listItems
boolean
true
Also check list items inside blockquotes.
no-trailing-spaces
Option
Type
Default
Description
brSpaces
number
2
Trailing spaces that count as a hard line break and are allowed.
codeBlocks
boolean
false
Check code blocks.
listItemEmptyLines
boolean
false
Allow trailing spaces on empty lines inside list items.
strict
boolean
false
Report every trailing space, including hard line breaks.
ol-prefix
Option
Type
Default
Description
style
string
one_or_ordered
one, ordered, one_or_ordered, or zero.
proper-names
Option
Type
Default
Description
names
[string]
[]
Names with their correct capitalization.
codeBlocks
boolean
true
Check code blocks.
htmlElements
boolean
true
Check HTML elements.
reference-links-images
Option
Type
Default
Description
shortcutSyntax
boolean
false
Also check shortcut references such as [label].
ignoredLabels
[string]
['x']
Labels that are not checked.
required-headings
Option
Type
Default
Description
headings
[string]
The required headings in order. * matches zero or more headings, + one or more, and ? zero or one.
matchCase
boolean
false
Compare heading text with regard to case.
table-column-style
Option
Type
Default
Description
style
string
any
any, aligned, compact, or tight.
alignedDelimiter
boolean
false
Require the delimiter row to be aligned with the columns.
ul-indent
Option
Type
Default
Description
indent
number
2
Spaces per nesting level.
startIndented
boolean
false
Allow the first level to be indented.
startIndent
number
2
Spaces of indentation for the first level when startIndented is on.
Front matter
The front-matter rule validates front matter against a JSON Schema with the same validator that Redocly CLI uses for API descriptions. Map file globs to schemas. The first mapping that matches a file wins, and a file that matches no mapping is not checked.
An inline JSON Schema, or the name of a built-in schema. realm is the only built-in schema.
schemaFile
string
Path to a YAML or JSON schema file, relative to the working directory. Used when schema is not set.
strict
boolean
Report keys the schema does not define. Default false.
A file with no front matter validates as an empty object, so the schema's required list decides whether front matter is mandatory. Each finding points at the line of the offending top-level key. Front matter that is not valid YAML is one finding at the start of the block.
The built-in realm schema checks the type of every front matter option that a Realm page accepts, such as title, description, slug, sidebar, excludeFromSearch, and the options that override redocly.yaml on one page. It does not check the inner shape of those option objects, because Realm evolves them independently. strict is off by default, because pages often carry their own keys that Markdoc templates read back through $frontmatter.