Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

markdownlint

DavidAnson2.2mMIT0.37.4TypeScript support: included

A Node.js style checker and lint tool for Markdown/CommonMark files.

markdown, lint, md, CommonMark, markdownlint

readme

markdownlint

A Node.js style checker and lint tool for Markdown/CommonMark files.

npm version License

Install

npm install markdownlint --save-dev

Overview

The Markdown markup language is designed to be easy to read, write, and understand. It succeeds - and its flexibility is both a benefit and a drawback. Many styles are possible, so formatting can be inconsistent; some constructs don't work well in all parsers and should be avoided.

markdownlint is a static analysis tool for Node.js with a library of rules to enforce standards and consistency for Markdown files. It was inspired by - and heavily influenced by - Mark Harrison's markdownlint for Ruby. The initial rules, rule documentation, and test cases came from that project.

markdownlint uses the micromark parser and honors the CommonMark specification for Markdown. It additionally supports popular GitHub Flavored Markdown (GFM) syntax like autolinks and tables as well as directives, footnotes, and math syntax - all implemented by micromark extensions.

References

The following specifications are considered authoritative in cases of ambiguity:

Demonstration

markdownlint demo, an interactive, in-browser playground for learning and exploring.

Rules / Aliases

  • MD001 heading-increment - Heading levels should only increment by one level at a time
  • MD003 heading-style - Heading style
  • MD004 ul-style - Unordered list style
  • MD005 list-indent - Inconsistent indentation for list items at the same level
  • MD007 ul-indent - Unordered list indentation
  • MD009 no-trailing-spaces - Trailing spaces
  • MD010 no-hard-tabs - Hard tabs
  • MD011 no-reversed-links - Reversed link syntax
  • MD012 no-multiple-blanks - Multiple consecutive blank lines
  • MD013 line-length - Line length
  • MD014 commands-show-output - Dollar signs used before commands without showing output
  • MD018 no-missing-space-atx - No space after hash on atx style heading
  • MD019 no-multiple-space-atx - Multiple spaces after hash on atx style heading
  • MD020 no-missing-space-closed-atx - No space inside hashes on closed atx style heading
  • MD021 no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading
  • MD022 blanks-around-headings - Headings should be surrounded by blank lines
  • MD023 heading-start-left - Headings must start at the beginning of the line
  • MD024 no-duplicate-heading - Multiple headings with the same content
  • MD025 single-title/single-h1 - Multiple top-level headings in the same document
  • MD026 no-trailing-punctuation - Trailing punctuation in heading
  • MD027 no-multiple-space-blockquote - Multiple spaces after blockquote symbol
  • MD028 no-blanks-blockquote - Blank line inside blockquote
  • MD029 ol-prefix - Ordered list item prefix
  • MD030 list-marker-space - Spaces after list markers
  • MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
  • MD032 blanks-around-lists - Lists should be surrounded by blank lines
  • MD033 no-inline-html - Inline HTML
  • MD034 no-bare-urls - Bare URL used
  • MD035 hr-style - Horizontal rule style
  • MD036 no-emphasis-as-heading - Emphasis used instead of a heading
  • MD037 no-space-in-emphasis - Spaces inside emphasis markers
  • MD038 no-space-in-code - Spaces inside code span elements
  • MD039 no-space-in-links - Spaces inside link text
  • MD040 fenced-code-language - Fenced code blocks should have a language specified
  • MD041 first-line-heading/first-line-h1 - First line in a file should be a top-level heading
  • MD042 no-empty-links - No empty links
  • MD043 required-headings - Required heading structure
  • MD044 proper-names - Proper names should have the correct capitalization
  • MD045 no-alt-text - Images should have alternate text (alt text)
  • MD046 code-block-style - Code block style
  • MD047 single-trailing-newline - Files should end with a single newline character
  • MD048 code-fence-style - Code fence style
  • MD049 emphasis-style - Emphasis style
  • MD050 strong-style - Strong style
  • MD051 link-fragments - Link fragments should be valid
  • MD052 reference-links-images - Reference links and images should use a label that is defined
  • MD053 link-image-reference-definitions - Link and image reference definitions should be needed
  • MD054 link-image-style - Link and image style
  • MD055 table-pipe-style - Table pipe style
  • MD056 table-column-count - Table column count
  • MD058 blanks-around-tables - Tables should be surrounded by blank lines

See Rules.md for more details.

Custom Rules

In addition to built-in rules, custom rules can be used to address project-specific requirements. To find community-developed rules use keyword markdownlint-rule on npm. To implement your own rules, refer to CustomRules.md.

Tags

Tags group related rules and can be used to enable/disable multiple rules at once.

  • accessibility - MD045
  • atx - MD018, MD019
  • atx_closed - MD020, MD021
  • blank_lines - MD012, MD022, MD031, MD032, MD047
  • blockquote - MD027, MD028
  • bullet - MD004, MD005, MD007, MD032
  • code - MD014, MD031, MD038, MD040, MD046, MD048
  • emphasis - MD036, MD037, MD049, MD050
  • hard_tab - MD010
  • headings - MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
  • hr - MD035
  • html - MD033
  • images - MD045, MD052, MD053, MD054
  • indentation - MD005, MD007, MD027
  • language - MD040
  • line_length - MD013
  • links - MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054
  • ol - MD029, MD030, MD032
  • spaces - MD018, MD019, MD020, MD021, MD023
  • spelling - MD044
  • table - MD055, MD056, MD058
  • ul - MD004, MD005, MD007, MD030, MD032
  • url - MD034
  • whitespace - MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039

Configuration

Text passed to markdownlint is parsed as Markdown, analyzed, and any issues reported. Two kinds of text are ignored by most rules:

Rules can be enabled, disabled, and configured via options.config (described below) to define the expected behavior for a set of inputs. To enable or disable rules at a particular location within a file, add one of these markers to the appropriate place (HTML comments don't appear in the final markup):

  • Disable all rules: <!-- markdownlint-disable -->
  • Enable all rules: <!-- markdownlint-enable -->
  • Disable all rules for the current line: <!-- markdownlint-disable-line -->
  • Disable all rules for the next line: <!-- markdownlint-disable-next-line -->
  • Disable one or more rules by name: <!-- markdownlint-disable MD001 MD005 -->
  • Enable one or more rules by name: <!-- markdownlint-enable MD001 MD005 -->
  • Disable one or more rules by name for the current line: <!-- markdownlint-disable-line MD001 MD005 -->
  • Disable one or more rules by name for the next line: <!-- markdownlint-disable-next-line MD001 MD005 -->
  • Capture the current rule configuration: <!-- markdownlint-capture -->
  • Restore the captured rule configuration: <!-- markdownlint-restore -->

For example:

<!-- markdownlint-disable-next-line no-space-in-emphasis -->
space * in * emphasis

Or:

space * in * emphasis <!-- markdownlint-disable-line no-space-in-emphasis -->

Or:

<!-- markdownlint-disable no-space-in-emphasis -->
space * in * emphasis
<!-- markdownlint-enable no-space-in-emphasis -->

To temporarily disable rule(s), then restore the former configuration:

<!-- markdownlint-capture -->
<!-- markdownlint-disable -->
any violations you want
<!-- markdownlint-restore -->

The initial configuration is captured by default (as if every document began with <!-- markdownlint-capture -->), so the pattern above can be expressed more simply:

<!-- markdownlint-disable -->
any violations you want
<!-- markdownlint-restore -->

Changes take effect starting with the line a comment is on, so the following has no effect:

space * in * emphasis <!-- markdownlint-disable --> <!-- markdownlint-enable -->

To apply changes to an entire file regardless of where the comment is located, the following syntax is supported:

  • Disable all rules: <!-- markdownlint-disable-file -->
  • Enable all rules: <!-- markdownlint-enable-file -->
  • Disable one or more rules by name: <!-- markdownlint-disable-file MD001 -->
  • Enable one or more rules by name: <!-- markdownlint-enable-file MD001 -->

This can be used to "hide" markdownlint comments at the bottom of a file.

In cases where it is desirable to change the configuration of one or more rules for a file, the following more advanced syntax is supported:

  • Configure: <!-- markdownlint-configure-file { options.config JSON } -->

For example:

<!-- markdownlint-configure-file { "hr-style": { "style": "---" } } -->

or

<!-- markdownlint-configure-file
{
  "hr-style": {
    "style": "---"
  },
  "no-trailing-spaces": false
}
-->

These changes apply to the entire file regardless of where the comment is located. Multiple such comments (if present) are applied top-to-bottom. By default, content of markdownlint-configure-file is assumed to be JSON, but options.configParsers can be used to support alternate formats.

API

Linting

Asynchronous API via import { lint } from "markdownlint/async":

/**
 * Lint specified Markdown files.
 *
 * @param {Options | null} options Configuration options.
 * @param {LintCallback} callback Callback (err, result) function.
 * @returns {void}
 */
function lint(options, callback) { ... }

Synchronous API via import { lint } from "markdownlint/sync":

/**
 * Lint specified Markdown files.
 *
 * @param {Options | null} options Configuration options.
 * @returns {LintResults} Results object.
 */
function lint(options) { ... }

Promise API via import { lint } from "markdownlint/promise":

/**
 * Lint specified Markdown files.
 *
 * @param {Options | null} options Configuration options.
 * @returns {Promise<LintResults>} Results object.
 */
function lint(options) { ... }

options

Type: Object

Configures the function. All properties are optional, but at least one of files or strings should be set to provide input.

options.config

Type: Object mapping String to Boolean | Object

Configures the rules to use.

Object keys are rule names/aliases; object values are the rule's configuration. The value false disables a rule, true enables its default configuration, and passing an object value customizes that rule. Setting the special default rule to true or false includes/excludes all rules by default. In the absence of a configuration object, all rules are enabled. Enabling or disabling a tag name (ex: whitespace) affects all rules having that tag.

The default rule is applied first, then keys are processed in order from top to bottom with later values overriding earlier ones. Keys (including rule names, aliases, tags, and default) are not case-sensitive.

Example:

{
  "default": true,
  "MD003": { "style": "atx_closed" },
  "MD007": { "indent": 4 },
  "no-hard-tabs": false,
  "whitespace": false
}

See .markdownlint.jsonc and/or .markdownlint.yaml for an example configuration object with all properties set to the default value.

Sets of rules (known as a "style") can be stored separately and loaded as JSON.

Example of referencing a built-in style from JavaScript:

const options = {
  "files": [ "..." ],
  "config": require("style/relaxed.json")
};

Example doing so from .markdownlint.json via extends (more on this below):

{
  "extends": "markdownlint/style/relaxed"
}

See the style directory for more samples.

See markdownlint-config-schema.json for the JSON Schema of the options.config object.

See ValidatingConfiguration.md for ways to use the JSON Schema to validate configuration.

For more advanced scenarios, styles can reference and extend other styles. The readConfig and readConfigSync functions can be used to read such styles.

For example, assuming a base.json configuration file:

{
  "default": true
}

And a custom.json configuration file:

{
  "extends": "base.json",
  "line-length": false
}

Then code like the following:

const options = {
  "config": markdownlint.readConfigSync("./custom.json")
};

Merges custom.json and base.json and is equivalent to:

const options = {
  "config": {
    "default": true,
    "line-length": false
  }
};
options.configParsers

Type: Optional Array of Function taking (String) and returning Object

Array of functions to parse the content of markdownlint-configure-file blocks.

As shown in the Configuration section, inline comments can be used to customize the configuration object for a document. By default, the JSON.parse built-in is used, but custom parsers can be specified. Content is passed to each parser function until one returns a value (vs. throwing an exception). As such, strict parsers should come before flexible ones.

For example:

[ JSON.parse, require("toml").parse, require("js-yaml").load ]
options.customRules

Type: Array of Object

List of custom rules to include with the default rule set for linting.

Each array element should define a rule. Rules are typically exported by another package, but can be defined locally.

Example:

const extraRules = require("extraRules");
const options = {
  "customRules": [ extraRules.one, extraRules.two ]
};

See CustomRules.md for details about authoring custom rules.

options.files

Type: Array of String

List of files to lint.

Each array element should be a single file (via relative or absolute path); globbing is the caller's responsibility.

Example: [ "one.md", "dir/two.md" ]

options.frontMatter

Type: RegExp

Matches any front matter found at the beginning of a file.

Some Markdown content begins with metadata; the default RegExp for this option ignores common forms of "front matter". To match differently, specify a custom RegExp or use the value null to disable the feature.

The default value:

/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m

Ignores YAML, TOML, and JSON front matter such as:

---
layout: post
title: Title
---

Note: Matches must occur at the start of the file.

options.fs

Type: Object implementing the file system API

In advanced scenarios, it may be desirable to bypass the default file system API. If a custom file system implementation is provided, markdownlint will use that instead of using node:fs.

Note: The only methods called are readFile and readFileSync.

options.handleRuleFailures

Type: Boolean

Catches exceptions thrown during rule processing and reports the problem as a rule violation.

By default, exceptions thrown by rules (or the library itself) are unhandled and bubble up the stack to the caller in the conventional manner. By setting handleRuleFailures to true, exceptions thrown by failing rules will be handled by the library and the exception message logged as a rule violation. This setting can be useful in the presence of (custom) rules that encounter unexpected syntax and fail. By enabling this option, the linting process is allowed to continue and report any violations that were found.

options.markdownItPlugins

Type: Array of Array of Function and plugin parameters

Specifies additional markdown-it plugins to use when parsing input. Plugins can be used to support additional syntax and features for advanced scenarios. Deprecated.

Each item in the top-level Array should be of the form:

[ require("markdown-it-plugin"), plugin_param_0, plugin_param_1, ... ]

Note that markdown-it plugins are only called when the markdown-it parser is invoked. None of the built-in rules use the markdown-it parser, so markdown-it plugins will only be invoked when one or more custom rules that use the markdown-it parser are present.

options.noInlineConfig

Type: Boolean

Disables the use of HTML comments like <!-- markdownlint-enable --> to toggle rules within the body of Markdown content.

By default, properly-formatted inline comments can be used to create exceptions for parts of a document. Setting noInlineConfig to true ignores all such comments.

options.resultVersion

Type: Number

Specifies which version of the result object to return (see the "Usage" section below for examples).

Passing a resultVersion of 0 corresponds to the original, simple format where each error is identified by rule name and line number. Deprecated

Passing a resultVersion of 1 corresponds to a detailed format where each error includes information about the line number, rule name, alias, description, as well as any additional detail or context that is available. Deprecated

Passing a resultVersion of 2 corresponds to a detailed format where each error includes information about the line number, rule names, description, as well as any additional detail or context that is available. Deprecated

Passing a resultVersion of 3 corresponds to the detailed version 2 format with additional information about how to fix automatically-fixable errors. In this mode, all errors that occur on each line are reported (other versions report only the first error for each rule). This is the default behavior.

options.strings

Type: Object mapping String to String

Map of identifiers to strings for linting.

When Markdown content is not available as files, it can be passed as strings. The keys of the strings object are used to identify each input value in the result summary.

Example:

{
  "readme": "# README\n...",
  "changelog": "# CHANGELOG\n..."
}

callback

Type: Function taking (Error, Object)

Standard completion callback.

result

Type: Object

Call result.toString() for convenience or see below for an example of the structure of the result object. Passing the value true to toString() uses rule aliases (ex: no-hard-tabs) instead of names (ex: MD010).

Config

The options.config configuration object is simple and can be stored in a file for readability and easy reuse. The readConfig and readConfigSync functions load configuration settings and support the extends keyword for referencing other files (see above).

By default, configuration files are parsed as JSON (and named .markdownlint.json). Custom parsers can be provided to handle other formats like JSONC, YAML, and TOML.

Asynchronous API via import { readConfig } from "markdownlint/async":

/**
 * Read specified configuration file.
 *
 * @param {string} file Configuration file name.
 * @param {ConfigurationParser[] | ReadConfigCallback} [parsers] Parsing function(s).
 * @param {Object} [fs] File system implementation.
 * @param {ReadConfigCallback} [callback] Callback (err, result) function.
 * @returns {void}
 */
function readConfig(file, parsers, fs, callback) { ... }

Synchronous API via import { readConfig } from "markdownlint/sync":

/**
 * Read specified configuration file.
 *
 * @param {string} file Configuration file name.
 * @param {ConfigurationParser[]} [parsers] Parsing function(s).
 * @param {Object} [fs] File system implementation.
 * @returns {Configuration} Configuration object.
 */
function readConfig(file, parsers, fs) { ... }

Promise API via import { readConfig } from "markdownlint/promise":

/**
 * Read specified configuration file.
 *
 * @param {string} file Configuration file name.
 * @param {ConfigurationParser[]} [parsers] Parsing function(s).
 * @param {Object} [fs] File system implementation.
 * @returns {Promise<Configuration>} Configuration object.
 */
function readConfig(file, parsers, fs) { ... }

file

Type: String

Location of configuration file to read.

The file is resolved relative to the current working directory. If an extends key is present once read, its value will be resolved as a path relative to file and loaded recursively. Settings from a file referenced by extends are applied first, then those of file are applied on top (overriding any of the same keys appearing in the referenced file). If either the file or extends path begins with the ~ directory, it will act as a placeholder for the home directory.

parsers

Type: Optional Array of Function taking (String) and returning Object

Array of functions to parse configuration files.

The contents of a configuration file are passed to each parser function until one of them returns a value (vs. throwing an exception). Consequently, strict parsers should come before flexible parsers.

For example:

[ JSON.parse, require("toml").parse, require("js-yaml").load ]

fs

Type: Optional Object implementing the file system API

In advanced scenarios, it may be desirable to bypass the default file system API. If a custom file system implementation is provided, markdownlint will use that instead of invoking node:fs.

Note: The only methods called are readFile, readFileSync, access, and accessSync.

callback

Type: Function taking (Error, Object)

Standard completion callback.

result

Type: Object

Configuration object.

Fixing

Rules that can be fixed automatically include a fixInfo property which is outlined in the documentation for custom rules. To apply fixes consistently, the applyFix/applyFixes methods may be used via import { applyFix, applyFixes } from "markdownlint":

/**
 * Applies the specified fix to a Markdown content line.
 *
 * @param {string} line Line of Markdown content.
 * @param {RuleOnErrorFixInfo} fixInfo RuleOnErrorFixInfo instance.
 * @param {string} [lineEnding] Line ending to use.
 * @returns {string | null} Fixed content or null if deleted.
 */
function applyFix(line, fixInfo, lineEnding = "\n") { ... }

/**
 * Applies as many of the specified fixes as possible to Markdown content.
 *
 * @param {string} input Lines of Markdown content.
 * @param {RuleOnErrorInfo[]} errors RuleOnErrorInfo instances.
 * @returns {string} Fixed content.
 */
function applyFixes(input, errors) { ... }

Invoking applyFixes with the results of a call to lint can be done like so:

import { applyFixes } from "markdownlint";
import { lint as lintSync } from "markdownlint/sync";

const results = lintSync({ "strings": { "content": original } });
const fixed = applyFixes(original, results.content);

Miscellaneous

To get the semantic version of the library, the getVersion method can be used:

/**
 * Gets the (semantic) version of the library.
 *
 * @returns {string} SemVer string.
 */
function getVersion() { ... }

Invoking getVersion is simple:

import { getVersion } from "markdownlint";

// Displays the library version
console.log(getVersion());

Usage

Invoke lint and use the result object's toString method:

import { lint as lintAsync } from "markdownlint/async";

const options = {
  "files": [ "good.md", "bad.md" ],
  "strings": {
    "good.string": "# good.string\n\nThis string passes all rules.",
    "bad.string": "#bad.string\n\n#This string fails\tsome rules."
  }
};

lintAsync(options, function callback(error, results) {
  if (!error && results) {
    console.log(results.toString());
  }
});

Output:

bad.string: 3: MD010/no-hard-tabs Hard tabs [Column: 19]
bad.string: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.string"]
bad.string: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This string fails        some rules."]
bad.string: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.string"]
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails      some rules."]
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]

Or as a synchronous call:

import { lint as lintSync } from "markdownlint/sync";

const results = lintSync(options);
console.log(results.toString());

To examine the result object directly via a Promise-based call:

import { lint as lintPromise } from "markdownlint/promise";

const results = await lintPromise(options);
console.dir(results, { "colors": true, "depth": null });

Output:

{
  "good.md": [],
  "bad.md": [
    { "lineNumber": 3,
      "ruleNames": [ "MD010", "no-hard-tabs" ],
      "ruleDescription": "Hard tabs",
      "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md",
      "errorDetail": "Column: 17",
      "errorContext": null,
      "errorRange": [ 17, 1 ] },
    { "lineNumber": 1,
      "ruleNames": [ "MD018", "no-missing-space-atx" ],
      "ruleDescription": "No space after hash on atx style heading",
      "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md",
      "errorDetail": null,
      "errorContext": "#bad.md",
      "errorRange": [ 1, 2 ] },
    { "lineNumber": 3,
      "ruleNames": [ "MD018", "no-missing-space-atx" ],
      "ruleDescription": "No space after hash on atx style heading",
      "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md",
      "errorDetail": null,
      "errorContext": "#This file fails\tsome rules.",
      "errorRange": [ 1, 2 ] },
    { "lineNumber": 1,
      "ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
      "ruleDescription": "First line in a file should be a top-level heading",
      "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md",
      "errorDetail": null,
      "errorContext": "#bad.md",
      "errorRange": null }
  ]
}

Integration with the gulp build system is straightforward: gulpfile.cjs.

Integration with the Grunt build system is similar: Gruntfile.cjs.

Browser

markdownlint also works in the browser.

Generate normal and minified scripts with:

npm run build-demo

Then reference the markdownlint-browser script:

<script src="demo/markdownlint-browser.min.js"></script>

And call it like so:

const options = {
  "strings": {
    "content": "Some Markdown to lint."
  }
};

const results = globalThis.markdownlint.lintSync(options).toString();

Examples

For ideas how to integrate markdownlint into your workflow, refer to the following projects or one of the tools in the Related section:

For more advanced integration scenarios:

Contributing

See CONTRIBUTING.md for more information.

Releasing

See ReleaseProcess.md for more information.

History

See CHANGELOG.md.

changelog

Changelog

0.37.4

  • Stop using module.createRequire, export resolveModule

0.37.3

  • Tweak package.json dependencies to work with pnpm

0.37.2

  • Add subpath imports for overriding default bundler behavior
  • Improve MD032

0.37.1

  • Add support for "browser" condition (as used by webpack)

0.37.0

0.36.1

  • Fix behavior of MD054

0.36.0

  • Improve MD051
  • Move applyFix and applyFixes from helpers to core
  • Make micromark parser available to custom rules
  • Introduce ./micromark helpers exports
  • Update custom/rule documentation
  • Improve performance
  • Update dependencies

0.35.0

  • Add MD058/blanks-around-tables
  • Use micromark in MD001/MD003/MD009/MD010/MD013/MD014/MD019/MD021/MD023/ MD024/MD025/MD039/MD042/MD043
  • Improve MD018/MD020/MD031/MD034/MD044
  • markdown-it parser no longer invoked by default
  • Add strict version of JSON schema
  • Improve performance
  • Update dependencies

0.34.0

  • Use micromark in MD027/MD028/MD036/MD040/MD041/MD046/MD048
  • Improve MD013/MD034/MD049/MD050/MD051
  • Update custom rule requirements and documentation
  • Improve various TypeScript declarations
  • Update dependencies

0.33.0

  • Add MD055/table-pipe-style, MD056/table-column-count
  • Improve MD005/MD007/MD024/MD026/MD038
  • Incorporate micromark-extension-directive
  • Improve JSON schema, document validation
  • Reduce size of browser script
  • Update dependencies

0.32.1

  • Fix behavior of MD054

0.32.0

  • Remove deprecated MD002/MD006
  • Remove rule aliases for "header"
  • Add MD054/link-image-style
  • Use micromark in MD005/MD007/MD030
  • Improve MD022/MD026/MD034/MD037/MD038/MD045/MD051
  • Improve JSON schema and related examples
  • Provide type declaration for Configuration object
  • Remove support for end-of-life Node version 16
  • Update dependencies

0.31.1

  • Improve MD032/MD034
  • Update dependencies

0.31.0

  • Improve MD032/MD037/MD043/MD044/MD051/MD052
  • Improve performance
  • Update dependencies

0.30.0

  • Use micromark in MD022/MD026/MD032/MD037/MD045/MD051
  • Incorporate micromark-extension-math for math syntax
  • Allow custom rules to override information URL
  • Update dependencies

0.29.0

  • Update micromark parser dependencies for better performance
  • Use micromark in MD049/MD050
  • Improve MD034/MD037/MD044/MD049/MD050
  • Support multiple parsers in demo page
  • Remove support for end-of-life Node version 14
  • Update dependencies

0.28.2

  • Update dependencies for CVE-2023-2251

0.28.1

  • Update dependencies

0.28.0

  • Introduce micromark parser for better positional data (internal only)
  • Use micromark in MD013/MD033/MD034/MD035/MD038/MD044/MD052/MD053
  • Simplify file-based test cases
  • Unify browser script for demo page
  • Update dependencies

0.27.0

  • Improve MD011/MD013/MD022/MD031/MD032/MD033/MD034/MD040/MD043/MD051/MD053
  • Generate/separate documentation
  • Improve documentation
  • Update dependencies

0.26.2

  • Improve MD037/MD051/MD053

0.26.1

  • Improve MD051

0.26.0

  • Add MD051/MD052/MD053 for validating link fragments & reference links/images & link/image reference definitions (MD053 auto-fixable)
  • Improve MD010/MD031/MD035/MD039/MD042/MD044/MD049/MD050
  • Add markdownlint-disable-line inline comment
  • Support ~ paths in readConfig/Sync
  • Add configParsers option
  • Remove support for end-of-life Node version 12
  • Default resultVersion to 3
  • Update browser script to use ES2015
  • Simplify JSON schema
  • Address remaining CodeQL issues
  • Improve performance
  • Update dependencies

0.25.1

  • Update dependencies for CVE-2022-21670

0.25.0

  • Add MD049/MD050 for consistent emphasis/strong style (both auto-fixable)
  • Improve MD007/MD010/MD032/MD033/MD035/MD037/MD039
  • Support asynchronous custom rules
  • Improve performance
  • Improve CI process
  • Reduce dependencies
  • Update dependencies

0.24.0

  • Remove support for end-of-life Node version 10
  • Add support for custom file system module
  • Improve MD010/MD011/MD037/MD043/MD044
  • Improve TypeScript declaration file and JSON schema
  • Update dependencies

0.23.1

  • Work around lack of webpack support for dynamic calls to require(.resolve)

0.23.0

  • Add comprehensive example .markdownlint.jsonc/.markdownlint.yaml files
  • Add fix information for MD004/ul-style
  • Improve MD018/MD019/MD020/MD021/MD037/MD041
  • Improve HTML comment handling
  • Update test runner and test suite
  • Update dependencies

0.22.0

  • Allow extends in config to reference installed packages by name
  • Add markdownlint-disable-next-line inline comment
  • Support JSON front matter
  • Improve MD009/MD026/MD028/MD043
  • Update dependencies (including markdown-it to v12)

0.21.1

  • Improve MD011/MD031
  • Export getVersion API

0.21.0

  • Lint concurrently for better performance (async only)
  • Add Promise-based APIs
  • Update TypeScript declaration file
  • Hide toString on LintResults
  • Add ability to fix in browser demo
  • Allow custom rules in .markdownlint.json schema
  • Improve MD042/MD044
  • Improve documentation
  • Update dependencies

0.20.4

  • Fix regression in MD037
  • Improve MD034/MD044
  • Improve documentation

0.20.3

  • Fix regression in MD037
  • Improve MD044
  • Add automatic regression testing

0.20.2

  • Fix regression in MD037
  • Improve MD038

0.20.1

  • Fix regression in MD037

0.20.0

  • Add markdownlint-configure-file inline comment
  • Reimplement MD037
  • Improve MD005/MD007/MD013/MD018/MD029/MD031/MD034/MD038/MD039
  • Improve HTML comment handling
  • Update dependencies

0.19.0

  • Remove support for end-of-life Node version 8
  • Add fix information for MD005/list-indent
  • Improve MD007/MD013/MD014
  • Deprecate MD006/ul-start-left
  • Add rationale for every rule
  • Update test runner and code coverage
  • Add more JSDoc comments
  • Update dependencies

0.18.0

  • Add MD048/code-fence-style
  • Add fix information for MD007/ul-indent
  • Add markdownlint-disable-file/markdownlint-enable-file inline comments
  • Add type declaration file (.d.ts) for TypeScript dependents
  • Update schema
  • Improve MD006/MD007/MD009/MD013/MD030
  • Update dependencies

0.17.2

  • Improve MD020/MD033/MD044

0.17.1

  • Fix handling of front matter by fix information

0.17.0

  • Add resultVersion 3 to support fix information for default and custom rules
  • Add fix information for 24 rules
  • Update newline handling to match latest CommonMark specification
  • Improve MD014/MD037/MD039
  • Update dependencies

0.16.0

  • Add custom rule sample for linting code
  • Improve MD026/MD031/MD033/MD038
  • Update dependencies

0.15.0

  • Add markdownlint-capture/markdownlint-restore inline comments
  • Improve MD009/MD013/MD026/MD033/MD036
  • Update dependencies

0.14.2

  • Improve MD047
  • Add handleRuleFailures option

0.14.1

  • Improve MD033

0.14.0

  • Remove support for end-of-life Node version 6
  • Introduce markdownlint-rule-helpers
  • Add MD046/MD047
  • Improve MD033/MD034/MD039
  • Improve custom rule validation and in-browser demo
  • Update dependencies

0.13.0

  • Improve MD013/MD022/MD025/MD029/MD031/MD032/MD037/MD041
  • Deprecate MD002
  • Improve Pandoc YAML support
  • Update dependencies

0.12.0

  • Add information link for custom rules
  • Add markdownItPlugins for extensibility
  • Improve MD023/MD032/MD038
  • Update dependencies

0.11.0

  • Improve MD005/MD024/MD029/MD038
  • Improve custom rule example
  • Add CONTRIBUTING.md
  • Update dependencies

0.10.0

  • Add support for non-JSON configuration files
  • Pass file/string name to custom rules
  • Update dependencies

0.9.0

  • Remove support for end-of-life Node versions 0.10/0.12/4
  • Change "header" to "heading" per spec (non-breaking)
  • Improve MD003/MD009/MD041
  • Handle uncommon line-break characters
  • Refactor for ES6
  • Update dependencies

0.8.1

  • Update item loop to be iterative
  • Improve MD014
  • Update dependencies

0.8.0

  • Add support for using and authoring custom rules
  • Improve MD004/MD007/MD013
  • Add engines to package.json
  • Refactor
  • Update dependencies

0.7.0

  • resultVersion defaults to 2 (breaking change)
  • Add MD045
  • Improve MD029
  • Remove trimLeft/trimRight
  • Split rules
  • Refactor
  • Update dependencies

0.6.4

  • Improve MD029/MD042
  • Update dependencies

0.6.3

  • Improve highlighting for MD020

0.6.2

  • Improve MD013/MD027/MD034/MD037/MD038/MD041/MD044
  • Update dependencies

0.6.1

  • Update markdown-it versioning
  • Exclude demo/test from publishing

0.6.0

  • resultVersion defaults to 1 (breaking change)
  • Ignore HTML comments
  • TOML front matter
  • Fixes for MD044
  • Update dependencies

0.5.0

  • Add shareable configuration
  • Add noInlineConfig option
  • Add README.md links
  • Fix MD030
  • Improve MD009/MD041
  • Update dependencies

0.4.1

  • Fixes for MD038/front matter
  • Improvements to MD044
  • Update dependencies

0.4.0

  • Add MD044
  • Enhance MD013/MD032/MD041/MD042/MD043
  • Fix for MD038
  • Update dependencies

0.3.1

  • Fix regressions in MD032/MD038
  • Update dependencies

0.3.0

  • More detailed error reporting with resultVersion
  • Enhance MD010/MD012/MD036
  • Fixes for MD027/MD029/MD030
  • Include JSON schema dependencies

0.2.0

  • Add MD042/MD043
  • Enhance MD002/MD003/MD004/MD007/MD011/MD025/MD041
  • Update dependencies

0.1.1

  • Fix bug handling HTML in tables
  • Reference markdownlint-cli

0.1.0

  • Add aliases
  • Exceptions for MD033
  • Exclusions for MD013
  • Update dependencies

0.0.8

  • Support disabling/enabling rules inline
  • Improve code fence
  • Update dependencies

0.0.7

  • Add MD041
  • Improve MD003
  • Ignore front matter
  • Update dependencies

0.0.6

  • Improve performance
  • Simplify in-browser
  • Update dependencies

0.0.5

  • Add strings option to enable file-less scenarios
  • Add in-browser demo

0.0.4

  • Add tests MD033-MD040
  • Update dependencies

0.0.3

  • Add synchronous API
  • Improve documentation and code

0.0.2

  • Improve documentation, tests, and code

0.0.1

  • Initial release
  • Includes tests MD001-MD032