2015-03-12 23:42:06 -07:00
|
|
|
# markdownlint
|
|
|
|
|
2016-03-11 21:36:39 -08:00
|
|
|
> A Node.js style checker and lint tool for Markdown/CommonMark files.
|
2015-03-12 23:42:06 -07:00
|
|
|
|
2015-03-17 22:58:26 -07:00
|
|
|
[![npm version][npm-image]][npm-url]
|
|
|
|
[![License][license-image]][license-url]
|
|
|
|
|
2015-03-12 23:42:06 -07:00
|
|
|
## Install
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```bash
|
2015-03-12 23:42:06 -07:00
|
|
|
npm install markdownlint --save-dev
|
|
|
|
```
|
|
|
|
|
|
|
|
## Overview
|
|
|
|
|
2024-10-01 22:41:10 -07:00
|
|
|
The [Markdown][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][static-analysis] tool for
|
|
|
|
[Node.js][nodejs] 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][markdownlint-ruby] for Ruby. The initial rules, rule
|
|
|
|
documentation, and test cases came from that project.
|
|
|
|
|
2024-12-25 20:42:32 -08:00
|
|
|
`markdownlint` uses the [`micromark` parser][micromark] and honors the
|
2024-10-01 22:41:10 -07:00
|
|
|
[CommonMark][commonmark] specification for Markdown. It additionally supports
|
|
|
|
popular [GitHub Flavored Markdown (GFM)][gfm] syntax like autolinks and tables
|
|
|
|
as well as directives, footnotes, and math syntax - all implemented by
|
|
|
|
[`micromark` extensions][micromark-extensions].
|
|
|
|
|
|
|
|
[commonmark]: https://commonmark.org/
|
|
|
|
[gfm]: https://github.github.com/gfm/
|
|
|
|
[markdown]: https://en.wikipedia.org/wiki/Markdown
|
|
|
|
[markdownlint-ruby]: https://github.com/markdownlint/markdownlint
|
|
|
|
[micromark]: https://github.com/micromark/micromark
|
|
|
|
[micromark-extensions]: https://github.com/micromark/micromark?tab=readme-ov-file#list-of-extensions
|
|
|
|
[nodejs]: https://nodejs.org/
|
|
|
|
[static-analysis]: https://en.wikipedia.org/wiki/Static_program_analysis
|
2015-03-12 23:42:06 -07:00
|
|
|
|
2016-01-14 22:15:44 -08:00
|
|
|
### Related
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
- CLI
|
|
|
|
- [markdownlint-cli][markdownlint-cli] command-line interface for Node.js
|
2022-11-05 17:34:37 -07:00
|
|
|
([works with pre-commit][markdownlint-cli-precommit])
|
2022-12-13 17:11:43 -08:00
|
|
|
- [markdownlint-cli2][markdownlint-cli2] command-line interface for Node.js
|
2022-11-05 17:34:37 -07:00
|
|
|
([works with pre-commit][markdownlint-cli2-precommit])
|
2022-12-13 17:11:43 -08:00
|
|
|
- GitHub
|
2022-12-13 17:23:50 -08:00
|
|
|
- [GitHub Action for markdownlint-cli2][markdownlint-cli2-action]
|
2022-12-13 17:11:43 -08:00
|
|
|
- [GitHub Super-Linter Action][super-linter]
|
|
|
|
- [GitHub Actions problem matcher for
|
2022-11-05 17:34:37 -07:00
|
|
|
markdownlint-cli][markdownlint-problem-matcher]
|
2022-12-13 17:11:43 -08:00
|
|
|
- Editor
|
|
|
|
- [vscode-markdownlint extension for VS Code][vscode-markdownlint]
|
|
|
|
- [Sublime Text markdownlint for Sublime Text][sublimelinter]
|
|
|
|
- [coc-markdownlint extension for Vim/Neovim][coc]
|
|
|
|
- Tooling
|
|
|
|
- [eslint-plugin-markdownlint for the ESLint analyzer][eslint-plugin]
|
|
|
|
- [grunt-markdownlint for the Grunt task runner][grunt-markdownlint]
|
|
|
|
- [Cake.Markdownlint addin for Cake build automation system][cake]
|
|
|
|
- [Lombiq Node.js Extensions for MSBuild (.NET builds)][nodejs-extensions]
|
|
|
|
- Ruby
|
|
|
|
- [markdownlint/mdl gem for Ruby][rubygems-mdl]
|
2022-11-05 17:34:37 -07:00
|
|
|
|
|
|
|
[cake]: https://github.com/cake-contrib/Cake.Markdownlint
|
|
|
|
[coc]: https://github.com/fannheyward/coc-markdownlint
|
|
|
|
[eslint-plugin]: https://github.com/paweldrozd/eslint-plugin-markdownlint
|
|
|
|
[grunt-markdownlint]: https://github.com/sagiegurari/grunt-markdownlint
|
|
|
|
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
|
|
|
|
[markdownlint-cli-precommit]: https://github.com/igorshubovych/markdownlint-cli#use-with-pre-commit
|
|
|
|
[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2
|
2022-12-13 17:23:50 -08:00
|
|
|
[markdownlint-cli2-action]: https://github.com/marketplace/actions/markdownlint-cli2-action
|
2022-11-05 17:34:37 -07:00
|
|
|
[markdownlint-cli2-precommit]: https://github.com/DavidAnson/markdownlint-cli2#pre-commit
|
|
|
|
[markdownlint-problem-matcher]: https://github.com/xt0rted/markdownlint-problem-matcher
|
|
|
|
[nodejs-extensions]: https://github.com/Lombiq/NodeJs-Extensions
|
|
|
|
[rubygems-mdl]: https://rubygems.org/gems/mdl
|
2024-11-12 19:57:31 -08:00
|
|
|
[sublimelinter]: https://github.com/jonlabelle/SublimeLinter-contrib-markdownlint
|
2023-10-23 10:25:49 +02:00
|
|
|
[super-linter]: https://github.com/super-linter/super-linter
|
2022-11-05 17:34:37 -07:00
|
|
|
[vscode-markdownlint]: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
|
2015-03-12 23:42:06 -07:00
|
|
|
|
2023-05-26 20:28:21 -07:00
|
|
|
### References
|
|
|
|
|
|
|
|
The following specifications are considered authoritative in cases of ambiguity:
|
|
|
|
|
|
|
|
- [CommonMark](https://spec.commonmark.org/current/)
|
|
|
|
- [GitHub Flavored Markdown Spec](https://github.github.com/gfm/)
|
|
|
|
|
2015-05-07 18:24:35 -07:00
|
|
|
## Demonstration
|
|
|
|
|
2016-10-05 22:50:21 -07:00
|
|
|
[`markdownlint` demo](https://dlaa.me/markdownlint/), an interactive, in-browser
|
2015-05-07 18:24:35 -07:00
|
|
|
playground for learning and exploring.
|
|
|
|
|
2016-01-12 21:29:17 -08:00
|
|
|
## Rules / Aliases
|
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
<!-- markdownlint-disable line-length -->
|
|
|
|
|
2023-11-09 20:05:30 -08:00
|
|
|
- **[MD001](doc/md001.md)** *heading-increment* - Heading levels should only increment by one level at a time
|
|
|
|
- **[MD003](doc/md003.md)** *heading-style* - Heading style
|
2022-12-13 17:11:43 -08:00
|
|
|
- **[MD004](doc/md004.md)** *ul-style* - Unordered list style
|
|
|
|
- **[MD005](doc/md005.md)** *list-indent* - Inconsistent indentation for list items at the same level
|
|
|
|
- **[MD007](doc/md007.md)** *ul-indent* - Unordered list indentation
|
|
|
|
- **[MD009](doc/md009.md)** *no-trailing-spaces* - Trailing spaces
|
|
|
|
- **[MD010](doc/md010.md)** *no-hard-tabs* - Hard tabs
|
|
|
|
- **[MD011](doc/md011.md)** *no-reversed-links* - Reversed link syntax
|
|
|
|
- **[MD012](doc/md012.md)** *no-multiple-blanks* - Multiple consecutive blank lines
|
|
|
|
- **[MD013](doc/md013.md)** *line-length* - Line length
|
|
|
|
- **[MD014](doc/md014.md)** *commands-show-output* - Dollar signs used before commands without showing output
|
|
|
|
- **[MD018](doc/md018.md)** *no-missing-space-atx* - No space after hash on atx style heading
|
|
|
|
- **[MD019](doc/md019.md)** *no-multiple-space-atx* - Multiple spaces after hash on atx style heading
|
|
|
|
- **[MD020](doc/md020.md)** *no-missing-space-closed-atx* - No space inside hashes on closed atx style heading
|
|
|
|
- **[MD021](doc/md021.md)** *no-multiple-space-closed-atx* - Multiple spaces inside hashes on closed atx style heading
|
2023-11-09 20:05:30 -08:00
|
|
|
- **[MD022](doc/md022.md)** *blanks-around-headings* - Headings should be surrounded by blank lines
|
|
|
|
- **[MD023](doc/md023.md)** *heading-start-left* - Headings must start at the beginning of the line
|
|
|
|
- **[MD024](doc/md024.md)** *no-duplicate-heading* - Multiple headings with the same content
|
2022-12-13 17:11:43 -08:00
|
|
|
- **[MD025](doc/md025.md)** *single-title/single-h1* - Multiple top-level headings in the same document
|
|
|
|
- **[MD026](doc/md026.md)** *no-trailing-punctuation* - Trailing punctuation in heading
|
|
|
|
- **[MD027](doc/md027.md)** *no-multiple-space-blockquote* - Multiple spaces after blockquote symbol
|
|
|
|
- **[MD028](doc/md028.md)** *no-blanks-blockquote* - Blank line inside blockquote
|
|
|
|
- **[MD029](doc/md029.md)** *ol-prefix* - Ordered list item prefix
|
|
|
|
- **[MD030](doc/md030.md)** *list-marker-space* - Spaces after list markers
|
|
|
|
- **[MD031](doc/md031.md)** *blanks-around-fences* - Fenced code blocks should be surrounded by blank lines
|
|
|
|
- **[MD032](doc/md032.md)** *blanks-around-lists* - Lists should be surrounded by blank lines
|
|
|
|
- **[MD033](doc/md033.md)** *no-inline-html* - Inline HTML
|
|
|
|
- **[MD034](doc/md034.md)** *no-bare-urls* - Bare URL used
|
|
|
|
- **[MD035](doc/md035.md)** *hr-style* - Horizontal rule style
|
2023-11-09 20:05:30 -08:00
|
|
|
- **[MD036](doc/md036.md)** *no-emphasis-as-heading* - Emphasis used instead of a heading
|
2022-12-13 17:11:43 -08:00
|
|
|
- **[MD037](doc/md037.md)** *no-space-in-emphasis* - Spaces inside emphasis markers
|
|
|
|
- **[MD038](doc/md038.md)** *no-space-in-code* - Spaces inside code span elements
|
|
|
|
- **[MD039](doc/md039.md)** *no-space-in-links* - Spaces inside link text
|
|
|
|
- **[MD040](doc/md040.md)** *fenced-code-language* - Fenced code blocks should have a language specified
|
|
|
|
- **[MD041](doc/md041.md)** *first-line-heading/first-line-h1* - First line in a file should be a top-level heading
|
|
|
|
- **[MD042](doc/md042.md)** *no-empty-links* - No empty links
|
2023-11-09 20:05:30 -08:00
|
|
|
- **[MD043](doc/md043.md)** *required-headings* - Required heading structure
|
2022-12-13 17:11:43 -08:00
|
|
|
- **[MD044](doc/md044.md)** *proper-names* - Proper names should have the correct capitalization
|
|
|
|
- **[MD045](doc/md045.md)** *no-alt-text* - Images should have alternate text (alt text)
|
|
|
|
- **[MD046](doc/md046.md)** *code-block-style* - Code block style
|
|
|
|
- **[MD047](doc/md047.md)** *single-trailing-newline* - Files should end with a single newline character
|
|
|
|
- **[MD048](doc/md048.md)** *code-fence-style* - Code fence style
|
2023-10-25 20:05:19 -07:00
|
|
|
- **[MD049](doc/md049.md)** *emphasis-style* - Emphasis style
|
|
|
|
- **[MD050](doc/md050.md)** *strong-style* - Strong style
|
2022-12-13 17:11:43 -08:00
|
|
|
- **[MD051](doc/md051.md)** *link-fragments* - Link fragments should be valid
|
|
|
|
- **[MD052](doc/md052.md)** *reference-links-images* - Reference links and images should use a label that is defined
|
|
|
|
- **[MD053](doc/md053.md)** *link-image-reference-definitions* - Link and image reference definitions should be needed
|
2023-10-24 21:07:46 -07:00
|
|
|
- **[MD054](doc/md054.md)** *link-image-style* - Link and image style
|
2023-12-30 18:15:38 -08:00
|
|
|
- **[MD055](doc/md055.md)** *table-pipe-style* - Table pipe style
|
2024-01-04 23:07:55 -08:00
|
|
|
- **[MD056](doc/md056.md)** *table-column-count* - Table column count
|
2024-06-01 21:32:10 -07:00
|
|
|
- **[MD058](doc/md058.md)** *blanks-around-tables* - Tables should be surrounded by blank lines
|
2025-01-06 11:35:17 -05:00
|
|
|
- **[MD059](doc/md059.md)** *descriptive-link-text* - Link text should be descriptive
|
2015-03-14 22:34:28 -07:00
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
<!-- markdownlint-restore -->
|
|
|
|
|
2015-03-14 22:34:28 -07:00
|
|
|
See [Rules.md](doc/Rules.md) for more details.
|
2015-03-12 23:42:06 -07:00
|
|
|
|
2022-12-10 08:04:45 +05:30
|
|
|
### 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][markdownlint-rule].
|
|
|
|
To implement your own rules, refer to [CustomRules.md](doc/CustomRules.md).
|
|
|
|
|
|
|
|
[markdownlint-rule]: https://www.npmjs.com/search?q=keywords:markdownlint-rule
|
|
|
|
|
2015-03-16 22:31:18 -07:00
|
|
|
## Tags
|
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
Tags group related rules and can be used to enable/disable multiple
|
|
|
|
rules at once.
|
2018-05-24 21:57:32 -07:00
|
|
|
|
2025-01-06 11:35:17 -05:00
|
|
|
- **`accessibility`** - `MD045`, `MD059`
|
2022-12-13 17:11:43 -08:00
|
|
|
- **`atx`** - `MD018`, `MD019`
|
|
|
|
- **`atx_closed`** - `MD020`, `MD021`
|
|
|
|
- **`blank_lines`** - `MD012`, `MD022`, `MD031`, `MD032`, `MD047`
|
|
|
|
- **`blockquote`** - `MD027`, `MD028`
|
2023-11-09 19:47:15 -08:00
|
|
|
- **`bullet`** - `MD004`, `MD005`, `MD007`, `MD032`
|
2022-12-13 17:11:43 -08:00
|
|
|
- **`code`** - `MD014`, `MD031`, `MD038`, `MD040`, `MD046`, `MD048`
|
|
|
|
- **`emphasis`** - `MD036`, `MD037`, `MD049`, `MD050`
|
|
|
|
- **`hard_tab`** - `MD010`
|
2023-11-09 19:47:15 -08:00
|
|
|
- **`headings`** - `MD001`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`,
|
2022-10-30 15:13:19 -07:00
|
|
|
`MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043`
|
2022-12-13 17:11:43 -08:00
|
|
|
- **`hr`** - `MD035`
|
|
|
|
- **`html`** - `MD033`
|
2023-10-24 21:07:46 -07:00
|
|
|
- **`images`** - `MD045`, `MD052`, `MD053`, `MD054`
|
2023-11-09 19:47:15 -08:00
|
|
|
- **`indentation`** - `MD005`, `MD007`, `MD027`
|
2022-12-13 17:11:43 -08:00
|
|
|
- **`language`** - `MD040`
|
|
|
|
- **`line_length`** - `MD013`
|
2023-10-24 21:07:46 -07:00
|
|
|
- **`links`** - `MD011`, `MD034`, `MD039`, `MD042`, `MD051`, `MD052`, `MD053`,
|
2025-01-06 11:35:17 -05:00
|
|
|
`MD054`, `MD059`
|
2022-12-13 17:11:43 -08:00
|
|
|
- **`ol`** - `MD029`, `MD030`, `MD032`
|
|
|
|
- **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023`
|
|
|
|
- **`spelling`** - `MD044`
|
2024-06-01 21:32:10 -07:00
|
|
|
- **`table`** - `MD055`, `MD056`, `MD058`
|
2023-11-09 19:47:15 -08:00
|
|
|
- **`ul`** - `MD004`, `MD005`, `MD007`, `MD030`, `MD032`
|
2022-12-13 17:11:43 -08:00
|
|
|
- **`url`** - `MD034`
|
|
|
|
- **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`,
|
2022-11-05 17:34:37 -07:00
|
|
|
`MD037`, `MD038`, `MD039`
|
2015-03-16 22:31:18 -07:00
|
|
|
|
2015-09-26 16:55:33 -07:00
|
|
|
## Configuration
|
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
Text passed to `markdownlint` is parsed as Markdown, analyzed, and any
|
2023-05-26 20:28:21 -07:00
|
|
|
issues reported. Two kinds of text are ignored by most rules:
|
2017-07-16 23:08:47 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
- [HTML comments](https://www.w3.org/TR/html5/syntax.html#comments)
|
|
|
|
- [Front matter](https://jekyllrb.com/docs/frontmatter/) (see
|
2021-01-08 21:53:55 -08:00
|
|
|
`options.frontMatter` below)
|
2017-07-16 23:08:47 -07:00
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
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):
|
2015-09-26 16:55:33 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
- 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:
|
2022-05-15 15:59:11 -07:00
|
|
|
`<!-- markdownlint-disable-line MD001 MD005 -->`
|
2022-12-13 17:11:43 -08:00
|
|
|
- Disable one or more rules by name for the next line:
|
2021-11-10 22:11:43 -08:00
|
|
|
`<!-- markdownlint-disable-next-line MD001 MD005 -->`
|
2022-12-13 17:11:43 -08:00
|
|
|
- Capture the current rule configuration: `<!-- markdownlint-capture -->`
|
|
|
|
- Restore the captured rule configuration: `<!-- markdownlint-restore -->`
|
2015-09-26 16:55:33 -07:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
2020-11-22 14:02:36 -08:00
|
|
|
```markdown
|
|
|
|
<!-- markdownlint-disable-next-line no-space-in-emphasis -->
|
2022-11-05 17:34:37 -07:00
|
|
|
space * in * emphasis
|
2020-11-22 14:02:36 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
Or:
|
|
|
|
|
2022-05-15 15:59:11 -07:00
|
|
|
```markdown
|
2022-11-05 17:34:37 -07:00
|
|
|
space * in * emphasis <!-- markdownlint-disable-line no-space-in-emphasis -->
|
2022-05-15 15:59:11 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
Or:
|
|
|
|
|
2018-03-03 22:22:02 -08:00
|
|
|
```markdown
|
2019-06-08 19:26:11 -07:00
|
|
|
<!-- markdownlint-disable no-space-in-emphasis -->
|
2022-11-05 17:34:37 -07:00
|
|
|
space * in * emphasis
|
2019-06-08 19:26:11 -07:00
|
|
|
<!-- markdownlint-enable no-space-in-emphasis -->
|
|
|
|
```
|
|
|
|
|
|
|
|
To temporarily disable rule(s), then restore the former configuration:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
<!-- markdownlint-capture -->
|
|
|
|
<!-- markdownlint-disable -->
|
|
|
|
any violations you want
|
|
|
|
<!-- markdownlint-restore -->
|
|
|
|
```
|
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
The initial configuration is captured by default (as if every document
|
|
|
|
began with `<!-- markdownlint-capture -->`), so the pattern above can
|
|
|
|
be expressed more simply:
|
2019-06-08 19:26:11 -07:00
|
|
|
|
|
|
|
```markdown
|
|
|
|
<!-- markdownlint-disable -->
|
|
|
|
any violations you want
|
|
|
|
<!-- markdownlint-restore -->
|
2015-09-26 16:55:33 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
Changes take effect starting with the line a comment is on, so the following
|
|
|
|
has no effect:
|
|
|
|
|
2018-03-03 22:22:02 -08:00
|
|
|
```markdown
|
2015-09-26 16:55:33 -07:00
|
|
|
space * in * emphasis <!-- markdownlint-disable --> <!-- markdownlint-enable -->
|
|
|
|
```
|
|
|
|
|
2019-12-04 21:31:49 -08:00
|
|
|
To apply changes to an entire file regardless of where the comment is located,
|
|
|
|
the following syntax is supported:
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
- 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 -->`
|
2019-12-04 21:31:49 -08:00
|
|
|
|
|
|
|
This can be used to "hide" `markdownlint` comments at the bottom of a file.
|
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
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:
|
2020-04-05 19:47:12 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
- Configure: `<!-- markdownlint-configure-file { options.config JSON } -->`
|
2020-04-05 19:47:12 -07:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
```markdown
|
2022-11-05 17:34:37 -07:00
|
|
|
<!-- markdownlint-configure-file { "hr-style": { "style": "---" } } -->
|
2020-04-05 19:47:12 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
<!-- markdownlint-configure-file
|
|
|
|
{
|
|
|
|
"hr-style": {
|
|
|
|
"style": "---"
|
|
|
|
},
|
|
|
|
"no-trailing-spaces": false
|
|
|
|
}
|
|
|
|
-->
|
|
|
|
```
|
|
|
|
|
2022-06-05 22:32:22 -07:00
|
|
|
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`](#optionsconfigparsers) can be used to support
|
|
|
|
alternate formats.
|
2020-04-05 19:47:12 -07:00
|
|
|
|
2015-03-15 23:39:17 -07:00
|
|
|
## API
|
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
### Linting
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Asynchronous API via `import { lint } from "markdownlint/async"`:
|
2015-03-20 00:09:55 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2015-03-15 23:39:17 -07:00
|
|
|
/**
|
2017-05-19 22:36:46 -07:00
|
|
|
* Lint specified Markdown files.
|
2015-03-15 23:39:17 -07:00
|
|
|
*
|
2024-12-03 19:58:28 -08:00
|
|
|
* @param {Options | null} options Configuration options.
|
2020-09-13 12:58:09 -07:00
|
|
|
* @param {LintCallback} callback Callback (err, result) function.
|
2015-03-15 23:39:17 -07:00
|
|
|
* @returns {void}
|
|
|
|
*/
|
2024-12-03 19:58:28 -08:00
|
|
|
function lint(options, callback) { ... }
|
2015-03-15 23:39:17 -07:00
|
|
|
```
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Synchronous API via `import { lint } from "markdownlint/sync"`:
|
2015-03-20 00:09:55 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2015-03-20 00:09:55 -07:00
|
|
|
/**
|
2024-12-03 19:58:28 -08:00
|
|
|
* Lint specified Markdown files.
|
2015-03-20 00:09:55 -07:00
|
|
|
*
|
2024-12-03 19:58:28 -08:00
|
|
|
* @param {Options | null} options Configuration options.
|
2020-09-13 12:58:09 -07:00
|
|
|
* @returns {LintResults} Results object.
|
2015-03-20 00:09:55 -07:00
|
|
|
*/
|
2024-12-03 19:58:28 -08:00
|
|
|
function lint(options) { ... }
|
2015-03-20 00:09:55 -07:00
|
|
|
```
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Promise API via `import { lint } from "markdownlint/promise"`:
|
2020-09-13 12:58:09 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2020-09-13 12:58:09 -07:00
|
|
|
/**
|
|
|
|
* Lint specified Markdown files.
|
|
|
|
*
|
2024-12-03 19:58:28 -08:00
|
|
|
* @param {Options | null} options Configuration options.
|
2020-09-13 12:58:09 -07:00
|
|
|
* @returns {Promise<LintResults>} Results object.
|
|
|
|
*/
|
2024-12-03 19:58:28 -08:00
|
|
|
function lint(options) { ... }
|
2020-09-13 12:58:09 -07:00
|
|
|
```
|
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
#### options
|
2015-03-15 23:39:17 -07:00
|
|
|
|
|
|
|
Type: `Object`
|
|
|
|
|
2021-08-12 19:38:03 -07:00
|
|
|
Configures the function. All properties are optional, but at least one
|
|
|
|
of `files` or `strings` should be set to provide input.
|
2015-03-15 23:39:17 -07:00
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
##### options.config
|
2015-03-15 23:39:17 -07:00
|
|
|
|
2015-03-16 22:31:18 -07:00
|
|
|
Type: `Object` mapping `String` to `Boolean | Object`
|
2015-03-15 23:39:17 -07:00
|
|
|
|
|
|
|
Configures the rules to use.
|
|
|
|
|
2024-08-24 22:20:04 -07:00
|
|
|
Object keys are rule names/aliases; object values are the rule's configuration.
|
2015-03-15 23:39:17 -07:00
|
|
|
The value `false` disables a rule, `true` enables its default configuration,
|
2024-08-24 22:20:04 -07:00
|
|
|
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.
|
2015-03-15 23:39:17 -07:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"default": true,
|
2015-03-18 09:38:32 -07:00
|
|
|
"MD003": { "style": "atx_closed" },
|
|
|
|
"MD007": { "indent": 4 },
|
2016-01-12 21:29:17 -08:00
|
|
|
"no-hard-tabs": false,
|
2015-03-18 09:40:01 -07:00
|
|
|
"whitespace": false
|
2015-03-15 23:39:17 -07:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-01-21 19:50:57 -08:00
|
|
|
See [.markdownlint.jsonc](schema/.markdownlint.jsonc) and/or
|
|
|
|
[.markdownlint.yaml](schema/.markdownlint.yaml) for an example
|
|
|
|
configuration object with all properties set to the default value.
|
2021-01-19 20:41:04 -08:00
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
Sets of rules (known as a "style") can be stored separately and loaded
|
|
|
|
as [JSON](https://en.wikipedia.org/wiki/JSON).
|
2015-03-18 09:38:32 -07:00
|
|
|
|
2022-10-02 19:28:54 -07:00
|
|
|
Example of referencing a built-in style from JavaScript:
|
2015-03-18 09:38:32 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2018-04-27 22:05:34 -07:00
|
|
|
const options = {
|
2015-03-18 09:38:32 -07:00
|
|
|
"files": [ "..." ],
|
|
|
|
"config": require("style/relaxed.json")
|
|
|
|
};
|
|
|
|
```
|
|
|
|
|
2022-10-02 19:28:54 -07:00
|
|
|
Example doing so from `.markdownlint.json` via `extends` (more on this below):
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"extends": "markdownlint/style/relaxed"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2015-03-18 09:38:32 -07:00
|
|
|
See the [style](style) directory for more samples.
|
|
|
|
|
2016-10-05 22:21:54 -07:00
|
|
|
See [markdownlint-config-schema.json](schema/markdownlint-config-schema.json)
|
2021-01-08 21:53:55 -08:00
|
|
|
for the [JSON Schema](https://json-schema.org/) of the `options.config`
|
|
|
|
object.
|
2016-10-05 22:21:54 -07:00
|
|
|
|
2023-11-26 20:14:21 -08:00
|
|
|
See [ValidatingConfiguration.md](schema/ValidatingConfiguration.md) for ways to
|
|
|
|
use the JSON Schema to validate configuration.
|
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
For more advanced scenarios, styles can reference and extend other styles.
|
|
|
|
The `readConfig` and `readConfigSync` functions can be used to read such
|
|
|
|
styles.
|
2017-05-19 22:36:46 -07:00
|
|
|
|
|
|
|
For example, assuming a `base.json` configuration file:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"default": true
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
And a `custom.json` configuration file:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"extends": "base.json",
|
|
|
|
"line-length": false
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Then code like the following:
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2018-04-27 22:05:34 -07:00
|
|
|
const options = {
|
2017-05-19 22:36:46 -07:00
|
|
|
"config": markdownlint.readConfigSync("./custom.json")
|
|
|
|
};
|
|
|
|
```
|
|
|
|
|
|
|
|
Merges `custom.json` and `base.json` and is equivalent to:
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2018-04-27 22:05:34 -07:00
|
|
|
const options = {
|
2017-05-19 22:36:46 -07:00
|
|
|
"config": {
|
|
|
|
"default": true,
|
|
|
|
"line-length": false
|
|
|
|
}
|
|
|
|
};
|
|
|
|
```
|
|
|
|
|
2022-06-05 22:32:22 -07:00
|
|
|
##### 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](#configuration) section, inline comments can be
|
|
|
|
used to customize the [configuration object](#optionsconfig) for a document. By
|
|
|
|
default, the `JSON.parse` built-in is used, but custom parsers can be specified.
|
2022-11-05 17:34:37 -07:00
|
|
|
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.
|
2022-06-05 22:32:22 -07:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2022-06-05 22:32:22 -07:00
|
|
|
[ JSON.parse, require("toml").parse, require("js-yaml").load ]
|
|
|
|
```
|
|
|
|
|
2022-06-04 15:06:07 -07:00
|
|
|
##### 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
|
2022-12-10 08:04:45 +05:30
|
|
|
by another package, but can be defined locally.
|
2022-06-04 15:06:07 -07:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2022-06-04 15:06:07 -07:00
|
|
|
const extraRules = require("extraRules");
|
|
|
|
const options = {
|
|
|
|
"customRules": [ extraRules.one, extraRules.two ]
|
|
|
|
};
|
|
|
|
```
|
|
|
|
|
|
|
|
See [CustomRules.md](doc/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](https://en.wikipedia.org/wiki/Glob_%28programming%29) is the
|
|
|
|
caller's responsibility.
|
|
|
|
|
|
|
|
Example: `[ "one.md", "dir/two.md" ]`
|
|
|
|
|
2017-05-21 22:58:10 -07:00
|
|
|
##### options.frontMatter
|
|
|
|
|
|
|
|
Type: `RegExp`
|
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
Matches any [front matter](https://jekyllrb.com/docs/frontmatter/)
|
|
|
|
found at the beginning of a file.
|
2017-05-21 22:58:10 -07:00
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
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.
|
2017-05-21 22:58:10 -07:00
|
|
|
|
2017-07-02 20:33:29 -07:00
|
|
|
The default value:
|
2017-05-21 22:58:10 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2024-10-05 18:07:45 -07:00
|
|
|
/((^---[^\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
|
2017-05-21 22:58:10 -07:00
|
|
|
```
|
|
|
|
|
2020-11-14 19:40:15 -08:00
|
|
|
Ignores [YAML](https://en.wikipedia.org/wiki/YAML),
|
|
|
|
[TOML](https://en.wikipedia.org/wiki/TOML), and
|
|
|
|
[JSON](https://en.wikipedia.org/wiki/JSON) front matter such as:
|
2017-05-21 22:58:10 -07:00
|
|
|
|
|
|
|
```text
|
|
|
|
---
|
|
|
|
layout: post
|
|
|
|
title: Title
|
|
|
|
---
|
|
|
|
```
|
|
|
|
|
2017-07-02 20:33:29 -07:00
|
|
|
Note: Matches must occur at the start of the file.
|
|
|
|
|
2022-06-04 15:06:07 -07:00
|
|
|
##### options.fs
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Type: `Object` implementing the [file system API][node-fs-api]
|
2022-06-04 15:06:07 -07:00
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
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
|
2024-11-23 19:04:28 -08:00
|
|
|
that instead of using `node:fs`.
|
2022-06-04 15:06:07 -07:00
|
|
|
|
|
|
|
Note: The only methods called are `readFile` and `readFileSync`.
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
[node-fs-api]: https://nodejs.org/api/fs.html
|
|
|
|
|
2019-05-18 12:32:52 -07:00
|
|
|
##### options.handleRuleFailures
|
|
|
|
|
|
|
|
Type: `Boolean`
|
|
|
|
|
2021-01-08 21:53:55 -08:00
|
|
|
Catches exceptions thrown during rule processing and reports the problem
|
|
|
|
as a rule violation.
|
2019-05-18 12:32:52 -07:00
|
|
|
|
|
|
|
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
|
2021-01-08 21:53:55 -08:00
|
|
|
`handleRuleFailures` to `true`, exceptions thrown by failing rules will
|
|
|
|
be handled by the library and the exception message logged as a rule violation.
|
2019-05-18 12:32:52 -07:00
|
|
|
This setting can be useful in the presence of (custom) rules that encounter
|
2021-01-08 21:53:55 -08:00
|
|
|
unexpected syntax and fail. By enabling this option, the linting process
|
|
|
|
is allowed to continue and report any violations that were found.
|
2019-05-18 12:32:52 -07:00
|
|
|
|
2024-12-25 20:42:32 -08:00
|
|
|
##### options.markdownItFactory
|
2022-06-04 15:06:07 -07:00
|
|
|
|
2024-12-25 20:42:32 -08:00
|
|
|
Type: `Function` returning an instance of a [`markdown-it` parser][markdown-it]
|
2022-06-04 15:06:07 -07:00
|
|
|
|
2024-12-25 20:42:32 -08:00
|
|
|
Provides a factory function for creating instances of the `markdown-it` parser.
|
2022-11-05 17:34:37 -07:00
|
|
|
|
2024-12-25 20:42:32 -08:00
|
|
|
Previous versions of the `markdownlint` library declared `markdown-it` as a
|
|
|
|
direct dependency. This function makes it possible to avoid that dependency
|
|
|
|
entirely. In cases where `markdown-it` is needed, the caller is responsible for
|
|
|
|
declaring the dependency and returning an instance from this factory. If any
|
|
|
|
[`markdown-it` plugins][markdown-it-plugin] are needed, they should be `use`d by
|
|
|
|
the caller before returning the `markdown-it` instance.
|
2022-06-04 15:06:07 -07:00
|
|
|
|
2024-12-27 21:22:14 -08:00
|
|
|
For compatibility with previous versions of `markdownlint`, this function should
|
|
|
|
be similar to:
|
2022-06-04 15:06:07 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2024-12-25 20:42:32 -08:00
|
|
|
import markdownIt from "markdown-it";
|
|
|
|
const markdownItFactory = () => markdownIt({ "html": true });
|
2022-06-04 15:06:07 -07:00
|
|
|
```
|
|
|
|
|
2024-12-27 21:22:14 -08:00
|
|
|
When an asynchronous implementation of `lint` is being invoked (e.g., via
|
|
|
|
`markdownlint/async` or `markdownlint/promise`), this function can return a
|
|
|
|
`Promise` in order to defer the import of `markdown-it`:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
const markdownItFactory = () => import("markdown-it").then((module) => module.default({ "html": true }));
|
|
|
|
```
|
|
|
|
|
2024-12-25 20:42:32 -08:00
|
|
|
> Note that this function is only invoked when a `markdown-it` parser is
|
|
|
|
> needed. None of the built-in rules use the `markdown-it` parser, so it is only
|
|
|
|
> invoked when one or more [custom rules][custom-rules] are present that use the
|
|
|
|
> `markdown-it` parser.
|
2024-08-21 21:19:40 -07:00
|
|
|
|
|
|
|
[custom-rules]: #custom-rules
|
2024-12-25 20:42:32 -08:00
|
|
|
[markdown-it]: https://github.com/markdown-it/markdown-it
|
|
|
|
[markdown-it-plugin]: https://www.npmjs.com/search?q=keywords:markdown-it-plugin
|
2024-08-21 21:19:40 -07:00
|
|
|
|
2017-05-21 22:58:10 -07:00
|
|
|
##### options.noInlineConfig
|
|
|
|
|
|
|
|
Type: `Boolean`
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Disables the use of HTML comments like `<!-- markdownlint-enable -->` to toggle
|
2017-05-21 22:58:10 -07:00
|
|
|
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.
|
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
##### options.resultVersion
|
2016-10-16 21:46:02 -07:00
|
|
|
|
|
|
|
Type: `Number`
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Specifies which version of the `result` object to return (see the "Usage"
|
|
|
|
section below for examples).
|
2016-10-16 21:46:02 -07:00
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Passing a `resultVersion` of `0` corresponds to the original, simple format
|
2024-10-01 22:41:10 -07:00
|
|
|
where each error is identified by rule name and line number. *Deprecated*
|
2016-10-16 21:46:02 -07:00
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Passing a `resultVersion` of `1` corresponds to a detailed format where each
|
|
|
|
error includes information about the line number, rule name, alias, description,
|
2024-10-01 22:41:10 -07:00
|
|
|
as well as any additional detail or context that is available. *Deprecated*
|
2018-01-12 23:21:06 -08:00
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Passing a `resultVersion` of `2` corresponds to a detailed format where each
|
|
|
|
error includes information about the line number, rule names, description, as
|
2024-10-01 22:41:10 -07:00
|
|
|
well as any additional detail or context that is available. *Deprecated*
|
2019-08-16 19:56:52 -07:00
|
|
|
|
|
|
|
Passing a `resultVersion` of `3` corresponds to the detailed version `2` format
|
2022-11-05 17:34:37 -07:00
|
|
|
with additional information about how to fix automatically-fixable errors. In
|
|
|
|
this mode, all errors that occur on each line are reported (other versions
|
2024-10-01 22:41:10 -07:00
|
|
|
report only the first error for each rule). This is the default behavior.
|
2016-10-16 21:46:02 -07:00
|
|
|
|
2022-06-04 15:06:07 -07:00
|
|
|
##### options.strings
|
2019-01-19 12:52:13 -08:00
|
|
|
|
2022-06-04 15:06:07 -07:00
|
|
|
Type: `Object` mapping `String` to `String`
|
2019-01-19 12:52:13 -08:00
|
|
|
|
2022-06-04 15:06:07 -07:00
|
|
|
Map of identifiers to strings for linting.
|
2021-08-12 19:38:03 -07:00
|
|
|
|
2022-06-04 15:06:07 -07:00
|
|
|
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.
|
2021-08-12 19:38:03 -07:00
|
|
|
|
2022-06-04 15:06:07 -07:00
|
|
|
Example:
|
2021-08-12 19:38:03 -07:00
|
|
|
|
2022-06-04 15:06:07 -07:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"readme": "# README\n...",
|
|
|
|
"changelog": "# CHANGELOG\n..."
|
|
|
|
}
|
|
|
|
```
|
2021-08-12 19:38:03 -07:00
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
#### callback
|
2015-03-15 23:39:17 -07:00
|
|
|
|
|
|
|
Type: `Function` taking (`Error`, `Object`)
|
|
|
|
|
2015-03-20 00:09:55 -07:00
|
|
|
Standard completion callback.
|
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
#### result
|
2015-03-20 00:09:55 -07:00
|
|
|
|
|
|
|
Type: `Object`
|
2015-03-15 23:39:17 -07:00
|
|
|
|
2015-03-20 00:09:55 -07:00
|
|
|
Call `result.toString()` for convenience or see below for an example of the
|
2016-01-12 21:29:17 -08:00
|
|
|
structure of the `result` object. Passing the value `true` to `toString()`
|
|
|
|
uses rule aliases (ex: `no-hard-tabs`) instead of names (ex: `MD010`).
|
2015-03-15 23:39:17 -07:00
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
### Config
|
|
|
|
|
2018-05-23 22:24:40 -07:00
|
|
|
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).
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
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.
|
2017-05-19 22:36:46 -07:00
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Asynchronous API via `import { readConfig } from "markdownlint/async"`:
|
2017-05-19 22:36:46 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2017-05-19 22:36:46 -07:00
|
|
|
/**
|
|
|
|
* Read specified configuration file.
|
|
|
|
*
|
2020-09-13 12:58:09 -07:00
|
|
|
* @param {string} file Configuration file name.
|
2024-11-30 21:44:37 -08:00
|
|
|
* @param {ConfigurationParser[] | ReadConfigCallback} [parsers] Parsing function(s).
|
2021-08-12 19:38:03 -07:00
|
|
|
* @param {Object} [fs] File system implementation.
|
2020-09-13 12:58:09 -07:00
|
|
|
* @param {ReadConfigCallback} [callback] Callback (err, result) function.
|
2017-05-19 22:36:46 -07:00
|
|
|
* @returns {void}
|
|
|
|
*/
|
2021-08-12 19:38:03 -07:00
|
|
|
function readConfig(file, parsers, fs, callback) { ... }
|
2017-05-19 22:36:46 -07:00
|
|
|
```
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Synchronous API via `import { readConfig } from "markdownlint/sync"`:
|
2017-05-19 22:36:46 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2017-05-19 22:36:46 -07:00
|
|
|
/**
|
2024-12-03 19:58:28 -08:00
|
|
|
* Read specified configuration file.
|
2017-05-19 22:36:46 -07:00
|
|
|
*
|
2020-09-13 12:58:09 -07:00
|
|
|
* @param {string} file Configuration file name.
|
|
|
|
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
|
2021-08-12 19:38:03 -07:00
|
|
|
* @param {Object} [fs] File system implementation.
|
2020-09-13 12:58:09 -07:00
|
|
|
* @returns {Configuration} Configuration object.
|
2017-05-19 22:36:46 -07:00
|
|
|
*/
|
2024-12-03 19:58:28 -08:00
|
|
|
function readConfig(file, parsers, fs) { ... }
|
2017-05-19 22:36:46 -07:00
|
|
|
```
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Promise API via `import { readConfig } from "markdownlint/promise"`:
|
2020-09-13 12:58:09 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2020-09-13 12:58:09 -07:00
|
|
|
/**
|
|
|
|
* Read specified configuration file.
|
|
|
|
*
|
|
|
|
* @param {string} file Configuration file name.
|
|
|
|
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
|
2021-08-12 19:38:03 -07:00
|
|
|
* @param {Object} [fs] File system implementation.
|
2020-09-13 12:58:09 -07:00
|
|
|
* @returns {Promise<Configuration>} Configuration object.
|
|
|
|
*/
|
2021-08-12 19:38:03 -07:00
|
|
|
function readConfig(file, parsers, fs) { ... }
|
2020-09-13 12:58:09 -07:00
|
|
|
```
|
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
#### file
|
|
|
|
|
|
|
|
Type: `String`
|
|
|
|
|
2018-05-23 22:24:40 -07:00
|
|
|
Location of configuration file to read.
|
2017-05-19 22:36:46 -07:00
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
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.
|
2017-05-19 22:36:46 -07:00
|
|
|
|
2018-05-23 22:24:40 -07:00
|
|
|
#### parsers
|
|
|
|
|
|
|
|
Type: *Optional* `Array` of `Function` taking (`String`) and returning `Object`
|
|
|
|
|
|
|
|
Array of functions to parse configuration files.
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
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.
|
2018-05-23 22:24:40 -07:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2021-02-06 19:23:55 -08:00
|
|
|
[ JSON.parse, require("toml").parse, require("js-yaml").load ]
|
2018-05-23 22:24:40 -07:00
|
|
|
```
|
|
|
|
|
2021-08-12 19:38:03 -07:00
|
|
|
#### fs
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Type: *Optional* `Object` implementing the [file system API][file-system-api]
|
|
|
|
|
|
|
|
[file-system-api]: https://nodejs.org/api/fs.html
|
2021-08-12 19:38:03 -07:00
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
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
|
2024-11-23 19:04:28 -08:00
|
|
|
that instead of invoking `node:fs`.
|
2021-08-12 19:38:03 -07:00
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Note: The only methods called are `readFile`, `readFileSync`, `access`, and
|
|
|
|
`accessSync`.
|
2021-08-12 19:38:03 -07:00
|
|
|
|
2017-05-19 22:36:46 -07:00
|
|
|
#### callback
|
|
|
|
|
|
|
|
Type: `Function` taking (`Error`, `Object`)
|
|
|
|
|
|
|
|
Standard completion callback.
|
|
|
|
|
|
|
|
#### result
|
|
|
|
|
|
|
|
Type: `Object`
|
|
|
|
|
|
|
|
Configuration object.
|
|
|
|
|
2024-10-06 17:24:44 -07:00
|
|
|
### Fixing
|
|
|
|
|
|
|
|
Rules that can be fixed automatically include a `fixInfo` property which is
|
|
|
|
outlined in the [documentation for custom rules](doc/CustomRules.md#authoring).
|
2024-12-03 19:58:28 -08:00
|
|
|
To apply fixes consistently, the `applyFix`/`applyFixes` methods may be used via
|
|
|
|
`import { applyFix, applyFixes } from "markdownlint"`:
|
2024-10-06 17:24:44 -07:00
|
|
|
|
|
|
|
```javascript
|
|
|
|
/**
|
|
|
|
* 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:
|
|
|
|
|
|
|
|
```javascript
|
2024-12-03 19:58:28 -08:00
|
|
|
import { applyFixes } from "markdownlint";
|
|
|
|
import { lint as lintSync } from "markdownlint/sync";
|
2024-10-06 17:24:44 -07:00
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
const results = lintSync({ "strings": { "content": original } });
|
|
|
|
const fixed = applyFixes(original, results.content);
|
2024-10-06 17:24:44 -07:00
|
|
|
```
|
|
|
|
|
2024-12-04 23:23:56 -08:00
|
|
|
### Miscellaneous
|
|
|
|
|
|
|
|
To get the [semantic version][semver] of the library, the `getVersion` method
|
|
|
|
can be used:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
/**
|
|
|
|
* Gets the (semantic) version of the library.
|
|
|
|
*
|
|
|
|
* @returns {string} SemVer string.
|
|
|
|
*/
|
|
|
|
function getVersion() { ... }
|
|
|
|
```
|
|
|
|
|
|
|
|
Invoking `getVersion` is simple:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
import { getVersion } from "markdownlint";
|
|
|
|
|
|
|
|
// Displays the library version
|
|
|
|
console.log(getVersion());
|
|
|
|
```
|
|
|
|
|
|
|
|
[semver]: https://semver.org
|
|
|
|
|
2015-03-12 23:42:06 -07:00
|
|
|
## Usage
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Invoke `lint` and use the `result` object's `toString` method:
|
2015-03-12 23:42:06 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2024-12-03 19:58:28 -08:00
|
|
|
import { lint as lintAsync } from "markdownlint/async";
|
2015-03-14 22:34:28 -07:00
|
|
|
|
2018-04-27 22:05:34 -07:00
|
|
|
const options = {
|
2015-04-29 18:46:52 -07:00
|
|
|
"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."
|
|
|
|
}
|
2015-03-14 22:34:28 -07:00
|
|
|
};
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
lintAsync(options, function callback(error, results) {
|
|
|
|
if (!error && results) {
|
|
|
|
console.log(results.toString());
|
2015-03-14 22:34:28 -07:00
|
|
|
}
|
|
|
|
});
|
|
|
|
```
|
|
|
|
|
2016-01-12 21:29:17 -08:00
|
|
|
Output:
|
2015-03-14 22:34:28 -07:00
|
|
|
|
|
|
|
```text
|
2017-07-05 21:53:21 -07:00
|
|
|
bad.string: 3: MD010/no-hard-tabs Hard tabs [Column: 19]
|
2018-03-19 23:39:42 +01:00
|
|
|
bad.string: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.string"]
|
2019-03-30 14:43:27 -07:00
|
|
|
bad.string: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This string fails some rules."]
|
2020-12-28 13:28:38 -08:00
|
|
|
bad.string: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.string"]
|
2017-07-05 21:53:21 -07:00
|
|
|
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
2018-03-19 23:39:42 +01:00
|
|
|
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
2019-03-30 14:43:27 -07:00
|
|
|
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
2020-12-28 13:28:38 -08:00
|
|
|
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]
|
2015-03-14 22:34:28 -07:00
|
|
|
```
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Or as a synchronous call:
|
2016-01-12 21:29:17 -08:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2024-12-03 19:58:28 -08:00
|
|
|
import { lint as lintSync } from "markdownlint/sync";
|
|
|
|
|
|
|
|
const results = lintSync(options);
|
|
|
|
console.log(results.toString());
|
2016-01-12 21:29:17 -08:00
|
|
|
```
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
To examine the `result` object directly via a `Promise`-based call:
|
2015-03-14 22:34:28 -07:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2024-12-03 19:58:28 -08:00
|
|
|
import { lint as lintPromise } from "markdownlint/promise";
|
|
|
|
|
|
|
|
const results = await lintPromise(options);
|
|
|
|
console.dir(results, { "colors": true, "depth": null });
|
2015-03-14 22:34:28 -07:00
|
|
|
```
|
|
|
|
|
2015-03-20 00:09:55 -07:00
|
|
|
Output:
|
2015-03-14 22:34:28 -07:00
|
|
|
|
2016-10-16 21:46:02 -07:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"good.md": [],
|
|
|
|
"bad.md": [
|
2016-10-16 21:46:02 -07:00
|
|
|
{ "lineNumber": 3,
|
2018-01-12 23:21:06 -08:00
|
|
|
"ruleNames": [ "MD010", "no-hard-tabs" ],
|
2016-10-16 21:46:02 -07:00
|
|
|
"ruleDescription": "Hard tabs",
|
2022-10-30 14:58:45 -07:00
|
|
|
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md",
|
2019-03-30 14:43:27 -07:00
|
|
|
"errorDetail": "Column: 17",
|
2016-10-31 22:53:46 -07:00
|
|
|
"errorContext": null,
|
2019-03-30 14:43:27 -07:00
|
|
|
"errorRange": [ 17, 1 ] },
|
2016-10-16 21:46:02 -07:00
|
|
|
{ "lineNumber": 1,
|
2018-01-12 23:21:06 -08:00
|
|
|
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
2018-03-19 23:39:42 +01:00
|
|
|
"ruleDescription": "No space after hash on atx style heading",
|
2022-10-30 14:58:45 -07:00
|
|
|
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md",
|
2016-10-16 21:46:02 -07:00
|
|
|
"errorDetail": null,
|
2016-10-31 22:53:46 -07:00
|
|
|
"errorContext": "#bad.md",
|
|
|
|
"errorRange": [ 1, 2 ] },
|
2016-10-16 21:46:02 -07:00
|
|
|
{ "lineNumber": 3,
|
2018-01-12 23:21:06 -08:00
|
|
|
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
2018-03-19 23:39:42 +01:00
|
|
|
"ruleDescription": "No space after hash on atx style heading",
|
2022-10-30 14:58:45 -07:00
|
|
|
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md",
|
2016-10-16 21:46:02 -07:00
|
|
|
"errorDetail": null,
|
2016-10-31 22:53:46 -07:00
|
|
|
"errorContext": "#This file fails\tsome rules.",
|
2017-07-05 21:53:21 -07:00
|
|
|
"errorRange": [ 1, 2 ] },
|
|
|
|
{ "lineNumber": 1,
|
2019-03-30 14:43:27 -07:00
|
|
|
"ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
|
2020-12-28 13:28:38 -08:00
|
|
|
"ruleDescription": "First line in a file should be a top-level heading",
|
2022-10-30 14:58:45 -07:00
|
|
|
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md",
|
2017-07-05 21:53:21 -07:00
|
|
|
"errorDetail": null,
|
|
|
|
"errorContext": "#bad.md",
|
|
|
|
"errorRange": null }
|
2016-10-16 21:46:02 -07:00
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Integration with the [gulp](https://gulpjs.com/) build system is
|
2024-11-28 20:36:44 -08:00
|
|
|
straightforward: [`gulpfile.cjs`](example/gulpfile.cjs).
|
2015-03-12 23:42:06 -07:00
|
|
|
|
2019-02-10 11:38:01 -08:00
|
|
|
Integration with the [Grunt](https://gruntjs.com/) build system is similar:
|
2024-11-28 20:36:44 -08:00
|
|
|
[`Gruntfile.cjs`](example/Gruntfile.cjs).
|
2015-03-14 23:47:34 -07:00
|
|
|
|
2015-06-17 18:35:11 -07:00
|
|
|
## Browser
|
|
|
|
|
2016-01-12 21:29:17 -08:00
|
|
|
`markdownlint` also works in the browser.
|
2015-06-17 18:35:11 -07:00
|
|
|
|
|
|
|
Generate normal and minified scripts with:
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```bash
|
2015-06-17 18:35:11 -07:00
|
|
|
npm run build-demo
|
|
|
|
```
|
|
|
|
|
2024-12-03 19:58:28 -08:00
|
|
|
Then reference the `markdownlint-browser` script:
|
2015-06-17 18:35:11 -07:00
|
|
|
|
|
|
|
```html
|
|
|
|
<script src="demo/markdownlint-browser.min.js"></script>
|
|
|
|
```
|
|
|
|
|
|
|
|
And call it like so:
|
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
```javascript
|
2018-04-27 22:05:34 -07:00
|
|
|
const options = {
|
2015-06-17 18:35:11 -07:00
|
|
|
"strings": {
|
|
|
|
"content": "Some Markdown to lint."
|
|
|
|
}
|
|
|
|
};
|
2024-12-03 19:58:28 -08:00
|
|
|
|
|
|
|
const results = globalThis.markdownlint.lintSync(options).toString();
|
2015-06-17 18:35:11 -07:00
|
|
|
```
|
|
|
|
|
2017-11-21 21:58:42 -08:00
|
|
|
## Examples
|
|
|
|
|
2021-03-06 20:46:07 +01:00
|
|
|
For ideas how to integrate `markdownlint` into your workflow, refer to the
|
2021-12-23 20:52:17 +00:00
|
|
|
following projects or one of the tools in the [Related section](#related):
|
2017-11-21 21:58:42 -08:00
|
|
|
|
2022-12-13 17:11:43 -08:00
|
|
|
- [.NET Documentation][dot-net-doc] ([Search repository][dot-net-doc-search])
|
|
|
|
- [ally.js][ally-js] ([Search repository][ally-js-search])
|
2022-12-19 21:15:35 -08:00
|
|
|
- [Apache Airflow][airflow] ([Search repository][airflow-search])
|
2022-12-13 17:11:43 -08:00
|
|
|
- [Boostnote][boostnote] ([Search repository][boostnote-search])
|
|
|
|
- [CodiMD][codimd] ([Search repository][codimd-search])
|
2022-12-19 21:15:35 -08:00
|
|
|
- [Electron][electron] ([Search repository][electron-search])
|
2022-12-13 17:11:43 -08:00
|
|
|
- [ESLint][eslint] ([Search repository][eslint-search])
|
|
|
|
- [Garden React Components][garden] ([Search repository][garden-search])
|
|
|
|
- [MDN Web Docs][mdn] ([Search repository][mdn-search])
|
|
|
|
- [MkDocs][mkdocs] ([Search repository][mkdocs-search])
|
|
|
|
- [Mocha][mocha] ([Search repository][mocha-search])
|
|
|
|
- [Pi-hole documentation][pi-hole] ([Search repository][pi-hole-search])
|
|
|
|
- [Reactable][reactable] ([Search repository][reactable-search])
|
|
|
|
- [V8][v8] ([Search repository][v8-search])
|
|
|
|
- [webhint][webhint] ([Search repository][webhint-search])
|
|
|
|
- [webpack][webpack] ([Search repository][webpack-search])
|
|
|
|
- [WordPress][wordpress] ([Search repository][wordpress-search])
|
2022-11-05 17:34:37 -07:00
|
|
|
|
2024-05-21 22:17:20 -07:00
|
|
|
For more advanced integration scenarios:
|
|
|
|
|
|
|
|
- [GitHub Docs content linter][content-linter]
|
|
|
|
- [GitHub's `markdownlint-github` repository][markdownlint-github]
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
[ally-js]: https://allyjs.io/
|
|
|
|
[ally-js-search]: https://github.com/medialize/ally.js/search?q=markdownlint
|
2022-12-19 21:15:35 -08:00
|
|
|
[airflow]: https://airflow.apache.org
|
|
|
|
[airflow-search]: https://github.com/apache/airflow/search?q=markdownlint
|
2022-11-05 17:34:37 -07:00
|
|
|
[boostnote]: https://boostnote.io/
|
|
|
|
[boostnote-search]: https://github.com/BoostIO/Boostnote/search?q=markdownlint
|
|
|
|
[codimd]: https://github.com/hackmdio/codimd
|
|
|
|
[codimd-search]: https://github.com/hackmdio/codimd/search?q=markdownlint
|
2024-05-21 22:17:20 -07:00
|
|
|
[content-linter]: https://docs.github.com/en/contributing/collaborating-on-github-docs/using-the-content-linter
|
2022-11-05 17:34:37 -07:00
|
|
|
[dot-net-doc]: https://docs.microsoft.com/en-us/dotnet/
|
|
|
|
[dot-net-doc-search]: https://github.com/dotnet/docs/search?q=markdownlint
|
2022-12-19 21:15:35 -08:00
|
|
|
[electron]: https://www.electronjs.org
|
|
|
|
[electron-search]: https://github.com/electron/electron/search?q=markdownlint
|
2022-11-05 17:34:37 -07:00
|
|
|
[eslint]: https://eslint.org/
|
|
|
|
[eslint-search]: https://github.com/eslint/eslint/search?q=markdownlint
|
|
|
|
[garden]: https://zendeskgarden.github.io/react-components/
|
|
|
|
[garden-search]: https://github.com/zendeskgarden/react-components/search?q=markdownlint
|
2024-05-21 22:17:20 -07:00
|
|
|
[markdownlint-github]: https://github.com/github/markdownlint-github
|
2022-11-05 17:34:37 -07:00
|
|
|
[mdn]: https://developer.mozilla.org/
|
|
|
|
[mdn-search]: https://github.com/mdn/content/search?q=markdownlint
|
|
|
|
[mkdocs]: https://www.mkdocs.org/
|
|
|
|
[mkdocs-search]: https://github.com/mkdocs/mkdocs/search?q=markdownlint
|
|
|
|
[mocha]: https://mochajs.org/
|
|
|
|
[mocha-search]: https://github.com/mochajs/mocha/search?q=markdownlint
|
|
|
|
[pi-hole]: https://docs.pi-hole.net
|
|
|
|
[pi-hole-search]: https://github.com/pi-hole/docs/search?q=markdownlint
|
|
|
|
[reactable]: https://glittershark.github.io/reactable/
|
|
|
|
[reactable-search]: https://github.com/glittershark/reactable/search?q=markdownlint
|
|
|
|
[v8]: https://v8.dev/
|
|
|
|
[v8-search]: https://github.com/v8/v8.dev/search?q=markdownlint
|
|
|
|
[webhint]: https://webhint.io/
|
|
|
|
[webhint-search]: https://github.com/webhintio/hint/search?q=markdownlint
|
|
|
|
[webpack]: https://webpack.js.org/
|
|
|
|
[webpack-search]: https://github.com/webpack/webpack.js.org/search?q=markdownlint
|
|
|
|
[wordpress]: https://wordpress.org/gutenberg/
|
|
|
|
[wordpress-search]: https://github.com/WordPress/gutenberg/search?q=markdownlint
|
2017-11-21 21:58:42 -08:00
|
|
|
|
2018-06-24 20:01:44 -07:00
|
|
|
## Contributing
|
|
|
|
|
|
|
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
|
|
|
2022-12-13 16:42:54 -08:00
|
|
|
## Releasing
|
|
|
|
|
|
|
|
See [ReleaseProcess.md](doc/ReleaseProcess.md) for more information.
|
|
|
|
|
2015-04-17 21:57:10 -07:00
|
|
|
## History
|
2015-03-12 23:42:06 -07:00
|
|
|
|
2023-01-05 22:24:04 -05:00
|
|
|
See [CHANGELOG.md](CHANGELOG.md).
|
2015-03-17 22:58:26 -07:00
|
|
|
|
|
|
|
[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
|
|
|
|
[npm-url]: https://www.npmjs.com/package/markdownlint
|
|
|
|
[license-image]: https://img.shields.io/npm/l/markdownlint.svg
|
2016-10-05 22:50:21 -07:00
|
|
|
[license-url]: https://opensource.org/licenses/MIT
|