Registry / devops / markdownlint-rs

markdownlint-rs

JSON →
library0.3.17jsnpmunverified

Opinionated Markdown formatter and linter, written in Rust. Inspired by ruff (Python) and gofmt (Go), it enforces a single canonical style with zero configuration. Version 0.3.17, released as an npm package with bundled platform-specific binaries. Active development; key differentiators: blazing fast (Rust), requires Node.js >=20, respects .gitignore, no config needed for default formatting, ESM-only wrapper. Unlike markdownlint (JS), it is opinionated and not rule-configurable. Aims to eliminate style debates and produce consistent diffs, particularly useful for AI-generated Markdown.

npm install markdownlint-rs
INSTALL
IMPORT
SIG · MARKDOWNLINT-RS
M
markdownlint-rs
devopsjavascriptv0.3.17
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mdlint (CLI)
npx mdlint check
mdlint check (without npx or global install)
If installed locally, use npx or add to npm scripts. No JavaScript API; purely CLI.
format command
npx mdlint format
mdlint format --fix (fix is redundant for format)
Format already applies all fixes; --fix is only for 'check'.
config file
npx mdlint check --config mdlint.toml
npx mdlint check --config .mdlrc.yaml
Config file must be in TOML format; no support for YAML or JSON.

Initialize project, install the package, create a sample Markdown file, format it, check it, output JSON, and apply auto-fixes.

npm init -y npm install --save-dev markdownlint-rs echo '# Hello World ## Subtitle This is a **test**.' > test.md npx mdlint format test.md npx mdlint check test.md npx mdlint check test.md --format json npx mdlint check test.md --fix
Debug
Known issues
gotchaNode.js version must be 20 or higher. Older versions cause silent failure or cryptic errors.
fix
Upgrade Node.js to >=20 or use the standalone binary from GitHub releases.
affects: <=19
breakingConfig file must be TOML (.toml). Using a different format like .yaml or .json is not supported.
fix
Convert config to TOML format and rename to mdlint.toml.
affects: >=0.1
breakingNo rule configuration. All formatting is opinionated and cannot be customized (by design).
fix
If custom rules are needed, use markdownlint (Node.js) or other linters.
affects: >=0.1
deprecatedThe --fix flag on 'mdlint check' is deprecated; use 'mdlint format' instead.
fix
Replace 'mdlint check --fix' with 'mdlint format'.
affects: >=0.3
gotchaRespects .gitignore by default; to lint files in ignored directories, pass them explicitly.
fix
Specify files directly: mdlint check path/to/ignored/file.md
affects: >=0.1
Errors
Common errors & fixes
Error: No such file or directory: 'mdlint'
mdlint not installed or not in PATH for the current shell session.
fix
Use npx mdlint or install globally: npm install -g markdownlint-rs
error: Unrecognized option: '--fix' (for format command)
--fix is not an option for 'mdlint format'; it only works with 'check'.
fix
Remove --fix from format command, or use 'mdlint check --fix'.
Error: Unsupported config format. Only .toml is supported.
Config file extension is not .toml.
fix
Rename config file to use .toml extension.
Upgrade
Version history
0.3.17latest on npm
Audit
Dependencies
noderequiredRuntime required for the npm wrapper; must be >=20
Agent activity
2 hits · last 30 days
node
2
Resources
markdownlint-rs — npm install markdownlint-rs · libregistry