Check, preview, then write
Lint without changing files, read the diff, and write when ready. A JSON report and exit codes serve CI, scripts, and agents.
One configuration for checks and formatting, for GitHub, Forgejo, Gitea, Obsidian, VitePress, or any CommonMark renderer.
npx mdrefine lint # report what the rules find, without changing files
npx mdrefine format --write # apply the fixesformat alone and format --diff preview the changes, and format --check fails a CI job on unformatted files; Getting started compares them.
mdrefine is meant to replace a general-purpose linter and formatter, such as markdownlint and Prettier, for Markdown documents. The comparison lists each of their checks with the rule that covers it and where it behaves differently.
Get started, browse the rules, or see examples of documents before and after formatting.