
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
@eslint/markdown
Advanced tools
Lint Markdown with ESLint, as well JS, JSX, TypeScript, and more inside Markdown.

Install the plugin alongside ESLint v9 or greater:
npm install --save-dev eslint @eslint/markdown
| Configuration Name | Description |
|---|---|
recommended | Lints all .md files with the recommended rules and assumes CommonMark format. |
processor | Enables extracting code blocks from all .md files so code blocks can be individually linted. |
In your eslint.config.js file, import @eslint/markdown and include the recommended config to enable Markdown parsing and linting:
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";
export default defineConfig([
markdown.configs.recommended
// your other configs here
]);
You can also modify the recommended config by using extends:
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";
export default defineConfig([
{
plugins: {
markdown
},
extends: ["markdown/recommended"],
rules: {
"markdown/no-html": "error"
}
}
// your other configs here
]);
| Rule Name | Description | Recommended |
|---|---|---|
fenced-code-language | Require languages for fenced code blocks | yes |
heading-increment | Enforce heading levels increment by one | yes |
no-duplicate-definitions | Disallow duplicate definitions | yes |
no-duplicate-headings | Disallow duplicate headings in the same document | no |
no-empty-definitions | Disallow empty definitions | yes |
no-empty-images | Disallow empty images | yes |
no-empty-links | Disallow empty links | yes |
no-html | Disallow HTML tags | no |
no-invalid-label-refs | Disallow invalid label references | yes |
no-missing-atx-heading-space | Disallow headings without a space after the hash characters | yes |
no-missing-label-refs | Disallow missing label references | yes |
no-multiple-h1 | Disallow multiple H1 headings in the same document | yes |
require-alt-text | Require alternative text for images | yes |
table-column-count | Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row | yes |
Note: This plugin does not provide formatting rules. We recommend using a source code formatter such as Prettier for that purpose.
In order to individually configure a rule in your eslint.config.js file, import @eslint/markdown and configure each rule with a prefix:
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";
export default defineConfig([
{
files: ["**/*.md"],
plugins: {
markdown
},
language: "markdown/commonmark",
rules: {
"markdown/no-html": "error"
}
}
]);
You can individually disable rules in Markdown using HTML comments, such as:
<!-- eslint-disable-next-line markdown/no-html -- I want to allow HTML here -->
<custom-element>Hello world!</custom-element>
<!-- eslint-disable markdown/no-html -- here too -->
<another-element>Goodbye world!</another-element>
<!-- eslint-enable markdown/no-html -- safe to re-enable now -->
[Object] <!-- eslint-disable-line markdown/no-missing-label-refs -- not meant to be a link ref -->
| Language Name | Description |
|---|---|
commonmark | Parse using CommonMark Markdown format |
gfm | Parse using GitHub-Flavored Markdown format |
In order to individually configure a language in your eslint.config.js file, import @eslint/markdown and configure a language:
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";
export default defineConfig([
{
files: ["**/*.md"],
plugins: {
markdown
},
language: "markdown/gfm",
rules: {
"markdown/no-html": "error"
}
}
]);
commonmark and gfmBy default, Markdown parsers do not support front matter. To enable front matter in both commonmark and gfm, you can use the frontmatter option in languageOptions.
@eslint/markdowninternally usesmicromark-extension-frontmatterandmdast-util-frontmatterto parse front matter.
| Option Value | Description |
|---|---|
false | Disables front matter parsing in Markdown files. (Default) |
"yaml" | Enables YAML front matter parsing in Markdown files. |
"toml" | Enables TOML front matter parsing in Markdown files. |
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";
export default defineConfig([
{
files: ["**/*.md"],
plugins: {
markdown
},
language: "markdown/gfm",
languageOptions: {
frontmatter: "yaml", // Or pass `"toml"` to enable TOML front matter parsing.
},
rules: {
"markdown/no-html": "error"
}
}
]);
| Processor Name | Description |
|---|---|
markdown | Extract fenced code blocks from the Markdown code so they can be linted separately. |
vscode-eslint has built-in support for the Markdown processor.
This processor will use file names from blocks if a filename meta is present.
For example, the following block will result in a parsed file name of src/index.js:
```js filename="src/index.js"
export const value = "Hello, world!";
```
This can be useful for user configurations that include linting overrides for specific file paths. In this example, you could then target the specific code block in your configuration using "file-name.md/*src/index.js".
$ git clone https://github.com/eslint/markdown.git
$ cd markdown
$ npm install
$ npm test
This project follows the ESLint contribution guidelines.
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. Become a Sponsor to get your logo on our READMEs and website.
FAQs
The official ESLint language plugin for Markdown
The npm package @eslint/markdown receives a total of 498,336 weekly downloads. As such, @eslint/markdown popularity was classified as popular.
We found that @eslint/markdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.