Adds a configuration file for Markdownlint.
Install the VSCode plugin Markdownlint by David Anson. Then add a local configuration file in .markdownlint.json
or markdownlint.jsonc
:
{
"extends": "@davidsneighbour/markdownlint-config"
}
The filename, and -format can be any of the ones listed on the markdownlint-cli2 configuration page but my advice is to stay with JSON or JSONC.
Add local rule overrides:
{
"extends": "@davidsneighbour/markdownlint-config",
"MD040": false
}
The configuration differs from the default ruleset in the following points:
- MD004 (unordered list style) is set to "consistent". That is by preference.
- MD013 (line-length) is disabled. I find that today the editor can take care of line flow and having only 80 characters long lines breaks the ease of working with these files.
- MD025 (single-title/single-h1) is disabled. The rule should be kept in mind, but every now and then multiple top level headlines are useful.
- MD030 (list-marker-space) is disabled. There is no reason to have two spaces after list item markers.
- MD041 (first-line-heading/first-line-h1) is disabled. Many README files might start with badges instead of headings.
Usage with CLI (or Lint Staged)
- Working with VSCode I suggest installing the plugin Markdown All In One by Yu Zhang.