Registry / testing / eslint-plugin-md

eslint-plugin-md

JSON →
library1.0.19jsnpmunverified

An ESLint plugin for linting and fixing Markdown files using remark-lint under the hood. Version 1.0.19 is the latest stable release, with no regular release cadence. Unlike eslint-plugin-markdown (which only lints JavaScript inside markdown), eslint-plugin-md lints the markdown content itself, supporting style enforcement and integration with prettier. It provides a single ESLint rule 'md/remark' that wraps remark-lint rules, and requires a custom parser 'markdown-eslint-parser'.

npm install eslint-plugin-md
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-MD
E
eslint-plugin-md
testingjavascriptv1.0.19
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

plugin
module.exports = { extends: ['plugin:md/recommended'] }
module.exports = { extends: ['md/recommended'] }
Must include 'plugin:' prefix in extends array. This is a common ESLint plugin convention.
rules (md/remark)
module.exports = { rules: { 'md/remark': ['error', { /* remark options */ }] } }
module.exports = { rules: { remark: ['error', {}] } }
The rule name is 'md/remark' (with the plugin prefix as namespace). Just 'remark' won't work.
parser
module.exports = { overrides: [{ files: ['*.md'], parser: 'markdown-eslint-parser' }] }
module.exports = { parser: 'markdown-eslint-parser' }
Parser must be specified inside an override for markdown files only, not globally, to avoid conflicts with JS files.

Minimal setup to lint markdown files with default remark rules using eslint-plugin-md.

// Install dependencies npm install eslint eslint-plugin-md markdown-eslint-parser --save-dev // .eslintrc.js module.exports = { extends: ['plugin:md/recommended'], overrides: [ { files: ['*.md'], parser: 'markdown-eslint-parser', }, ], }; // Lint markdown files (CLI) eslint . --ext js,md
Debug
Known issues
gotchaBy default ESLint does not lint .md files; must use --ext js,md on CLI or configure VSCode.
fix
Add --ext js,md to eslint command or set eslint.validate to ['markdown'] in VSCode settings.
affects: >=0.0.0
gotchaParser 'markdown-eslint-parser' must be set in an overrides section for '*.md' files only, not globally.
fix
Use overrides with files: ['*.md'] and parser: 'markdown-eslint-parser' inside that override.
affects: >=1.0.0
gotchaThe plugin exports a single rule 'md/remark'; custom remark options are passed as second argument to that rule.
fix
Configure rule as 'md/remark': ['error', { /* remark options */ }].
affects: >=1.0.0
gotchaJS code within fenced code blocks in .md files is linted with the same base ESLint config unless overridden.
fix
Add an override for files: ['*.md.js'] to apply different rules for JS snippets inside markdown.
affects: >=1.0.0
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-md".
Plugin not installed or not loaded correctly in ESLint config.
fix
Run npm install eslint-plugin-md --save-dev and ensure extends includes 'plugin:md/recommended'.
Configuration for rule "md/remark" is invalid: Value "[object Object]" is not a valid severity.
Rule configuration passed incorrectly (maybe extra array nesting).
fix
Set rule as 'md/remark': ['error', { /* options */ }] (array with two elements).
Error: Cannot find module 'markdown-eslint-parser'
markdown-eslint-parser not installed.
fix
Run npm install markdown-eslint-parser --save-dev.
Upgrade
Version history
1.0.19latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; required as a host for the plugin.
remark-lintrequiredUnderlying linting engine; used to enforce markdown style rules.
Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-md — npm install eslint-plugin-md · libregistry