What's new in 0.6
mdrefine 0.6 covers what markdownlint and Prettier check in Markdown, reads their settings when a project has no mdrefine configuration, and makes bare format a check. This page shows the changes with examples; the changelog lists every change, and upgrading says what to do when you update from 0.5.
Highlights
- The comparison with Prettier and markdownlint lists every markdownlint rule and every Prettier Markdown option with the mdrefine rule that covers it.
- A project with only a markdownlint or Prettier configuration gets those settings, and
mdrefine config convert --writeturns them into an mdrefine configuration. - 24 new rules, two of them in
recommended, and new options for fourteen existing rules. formatwithout--write,--check, or--difffails when a file would change.
Your markdownlint or Prettier settings
Without an mdrefine configuration, lint and format read a markdownlint or Prettier configuration in the workspace, convert it, and say so on stderr. With a .markdownlint.jsonc that asks for * bullets:
{
"MD004": { "style": "asterisk" },
"MD013": false,
}lint reports a - bullet at markdownlint's severity, error:
mdrefine: no mdrefine configuration; using markdownlint settings from .markdownlint.jsonc (2 conversion note(s): mdrefine config explain <file>; opt out: --no-competitor-config)
notes.md:3:1: error style/list-marker: Use "*" as the bullet list marker.
1 file(s) linted; 1 error(s), 0 warning(s).npx mdrefine config convert prints the converted configuration and notes on what it could not convert; --write saves it as mdrefine.config.jsonc. --no-competitor-config turns the fallback off. While it applies, markdownlint's inline configuration comments, Prettier's ignore comments, and Prettier's requirePragma apply too. The fallback lists the files it reads and leaves out.
format checks by default
Bare format prints the diff and exits 1 when a file would change, so it can run in CI as it is. format --diff prints the same diff and exits 0, format --check names the files, and format --write writes them; see exit codes.
Block quotes in recommended
style/quote-marker writes one space after each >, and style/lazy-continuation writes the > or the indentation on lines that continue a quote's or a list item's paragraph without it. Before:
>A quote whose text fills the line and goes on long enough to need a second line
when it is wrapped.After:
> A quote whose text fills the line and goes on long enough to need a second
> line when it is wrapped.More formatting in recommended
style/tableformats tables inside lists and block quotes.style/headingremoves a heading's indentation and writes one space after its hashes:## Installbecomes## Install.style/block-spacingputs a blank line around fenced code blocks and tables, as it does around headings and lists.content/image-altalso reports an HTML<img>without analtattribute.
Before:
Run it:
```sh
npm test
```
Then commit.After:
Run it:
```sh
npm test
```
Then commit.New rules in no preset
Enable these under rules in the configuration. Each rule's page has examples and options.
Style rules, which format fixes:
style/code-block: code blocks in one form, fenced or indented.style/definition-spacing: one space after a link reference definition's colon.style/line-ending: one line ending.style/link-title: one kind of delimiter for link titles.style/no-tabs: spaces instead of tabs in prose.style/prose-space: single spaces between words.links/allowed-notation: only the link forms you allow.links/bare-url: autolinks for bare URLs.
Problem rules, which report only:
content/emphasis-spacing,content/inline-code-spacing, andlinks/text-spacing: spaces inside markers that change what renderers show.content/html-element: HTML elements.content/line-length: long lines in headings, code blocks, and tables.content/proper-names: misspelled capitalization of names.content/shell-prompt:$prompts in shell blocks without output.links/descriptive-text: links whose text is "here".links/reversed: links written as(text)[url].structure/emphasis-heading: bold paragraphs used as headings.structure/heading-punctuation: headings that end with punctuation.structure/heading-template: a required sequence of headings.structure/split-quote: quotes split by a blank line.structure/unspaced-heading:#Headingwithout a space.
New options
style/wrap:mode: "never"joins each paragraph onto one line.style/table:pipeStyle,style: "tight",alignedDelimiter, andpadding: "alignment".style/block-spacing:linesAbove,linesBelow, andincludeFrontMatterfor headings.style/heading:closing: "add".style/emphasisandstyle/strong:marker: "consistent".style/trailing-space,style/thematic-break, andstyle/list-indent: the choices that markdownlint and Prettier offer.links/valid:ignoredFragmentsandexactCase.links/undefined-reference:shortcutSyntaxandignoredLabels.links/unused-definitionandlinks/empty:ignoredDefinitions, sorecommendedno longer reports a comment written as[//]: # (note).structure/heading-increment:frontMatterTitle.- Code formatters can format YAML and TOML front matter with a tool you choose.
Fixes
0.6.0 also has fourteen fixes, most of them in how rules read constructs that VitePress, Forgejo, Gitea, GitHub, or Obsidian render their own way. The changelog lists them, and the GitHub release has the full notes.
In 0.6.1
0.6.1 formats documents as 0.6.0 does. It reorganizes the documentation and smooths the command line:
- The rules have a page each, with the common case first and edge cases under their own headings; links to the former single page still reach them.
- Getting started shows what
lintprints, compares the forms offormatin a table, and covers running mdrefine without a Node.js project and with pnpm, Yarn, or Bun. - Upgrading gathers the steps for each release, and the glossary explains the terms that the pages use.
mdrefine ruleslists the rules sorted by ID, in plainer words, andmdrefinewithout a command says so after its help.- Piping the output into a program that stops reading early, such as
head, no longer ends with an error.
In 0.6.2
0.6.2 updates minimatch for a pattern-amplification advisory. mdrefine does not enable the affected optimization mode. The update preserves conversion of Markdown patterns in Prettier and EditorConfig settings. No configuration or workflow changes are required.
In 0.6.3
0.6.3 corrects configuration fallback and ignore matching:
- With an explicit
--root, converted ignore patterns, file selections and overrides resolve relative to that workspace. - Ignore matching follows Git for whole-component asterisk runs, and explaining a skipped input names the last matching rule. Prettier fallback keeps its settings when root Markdown files remain unignored.
- Initial-heading and heading-spacing checks used through markdownlint fallback no longer report false findings around HTML comments.
- Configuration discovery stops reading
.prettierrc.jsonc, which Prettier does not support.
The style/list-indent rule also keeps a list on its footnote definition's first line stable when startIndented: true. No upgrading steps are needed.
In 0.6.4
0.6.4 fixes heading checks and avoids refused formatting in several cases:
- Markdownlint fallback recognizes HTML headings and permitted preambles, and reports required heading spacing above comments and inside list items. If checking an HTML block reaches the nested-directive work limit, it reports that the check could not complete and leaves the document unchanged.
- VitePress wrapping handles body entities without false refusals and keeps code spans whose continuation indentation affects rendering. Spacing also keeps table text that belongs to an opaque component, while safe formatting nearby still applies.
- With a syntax plugin, wrapping keeps paragraphs whose new lines would start one of the plugin's blocks, while safe paragraphs still wrap.
- Parsing long list paragraphs with many unindented continuation lines avoids repeatedly searching the same accumulated events.
No configuration or upgrading steps are needed. The command structure and options are unchanged.
In 0.6.5
0.6.5 speeds up deeply nested lists and corrects VitePress paragraph wrapping:
Deeply nested lists parse faster with the built-in syntax. Syntax plugins retain their existing deep-list performance limits.
VitePress body paragraphs beginning with
---can wrap when syntax plugins are enabled. Previously, the wrapping check could mistake them for front matter and keep the whole paragraph as written. For example:markdownIntroduction. --- A long paragraph in the document body can now wrap with syntax plugins enabled.
No configuration or upgrading steps are needed. Commands and options are unchanged.