The recheck command lints Markdown files for prose and structure problems. It checks headings, sentences, links, images, and Markdoc tags against a set of rules.
Rules come from presets, such as recheck/markdown, that you add to the root extends in redocly.yaml. The recheck block adjusts those rules. With no redocly.yaml, the command uses recheck/markdown. With a redocly.yaml that has neither, the command checks nothing and says so. The command reads the root recheck config; settings under apis.<name> are not used.
redocly recheck
redocly recheck <paths>...
redocly recheck [--fix]
redocly recheck [--readability]
redocly recheck [--generate-baseline]
redocly recheck [--generate-markdoc-schema] [--from=<path>...] [--output=<path>] [--check]
redocly recheck --help
--readability, --generate-baseline, and --generate-markdoc-schema each replace the default lint action. Use at most one of them in a run. --fix works with the default lint action only.
| Option | Type | Description |
|---|---|---|
| paths | [string] | Files or directories to lint. Default value is the current directory. |
| --check | boolean | Fail when the generated schema differs from the file in --output. Use with --generate-markdoc-schema. |
| --config | string | Path to the configuration file. |
| --fix | boolean | Apply fixes to the Markdown files. Alias: -f. |
| --format | string | Format for the report. Possible values: table, json, sarif, github-actions. Default value is table. |
| --from | [string] | Module paths to read Markdoc tags from. Use with --generate-markdoc-schema. |
| --generate-baseline | boolean | Write a baseline file from the current errors. |
| --generate-markdoc-schema | boolean | Generate a Markdoc tag schema from theme modules. Needs --from and --output. |
| --help | boolean | Show help. |
| --lint-config | string | Specify the severity level for the configuration file. Possible values: warn, error, off. Default value is warn. |
| --max-problems | number | Maximum number of problems in the report; applies to every format. |
| --output | string | Output file for the generated schema. |
| --readability | boolean | Report readability scores instead of lint findings. |
| --rule | [string] | Run only these rules. Alias: -r. |
| --skip-rule | [string] | Skip these rules. |
| --stats | boolean | Print statistics per rule. Alias: -s. |
| --summary | string | Print a summary of the run. Possible values: json, text. |
| --summary-path | string | Write the summary to this file. |
| --tags | [string] | Run only rules with these tags. |
| --version | boolean | Show version number. |
Add a preset to the root extends:
extends:
- recheck/markdown
Then run the command on a folder:
redocly recheck docs
The command lints every Markdown file under docs with the rules from recheck/markdown. The report goes to stdout and progress messages go to stderr.
Set the rule to off in the recheck block:
extends:
- recheck/markdown
recheck:
rules:
recheck/line-length: off
The run applies every rule from recheck/markdown except recheck/line-length.
redocly recheck docs --format=github-actions
In a GitHub Actions workflow, this format adds each finding as an annotation on the changed line. An error becomes ::error, a warning ::warning, and an info finding ::notice. Each finding is one line of output:
::error title=recheck/single-h1,file=docs/index.md,line=2,endLine=2,col=1,endColumn=1::Multiple top-level headings in the same document
A baseline records the current errors. Later runs report only errors that the baseline does not list.
redocly recheck docs --generate-baseline
The command writes .redocly.recheck-baseline.yaml next to redocly.yaml. Commit the file. Later runs pick it up automatically.
After you fix errors, generate the baseline again and commit the smaller file.
redocly recheck docs --readability
The command prints readability scores for each Markdown file instead of lint findings.