The Markdownlint plugin in Visual Studio Code is raising an MD007 error.
I'd like to update the setting but can't work out how to find the options.config
referred to in the markdownlint documentation?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityThe Markdownlint plugin in Visual Studio Code is raising an MD007 error.
I'd like to update the setting but can't work out how to find the options.config
referred to in the markdownlint documentation?
The trick is explained in the vscode-markdownlint repo (diff from the primary markdownlint repo):
Rules can also be configured using Code's support for user and workspace settings.
In Visual Studio Code, open File -> Preferences -> Settings
or use CTRL + ,
Edit the User Settings
tab on the right to something like this:
"markdownlint.config": {
"default": true,
"MD007": { "indent": 4 }
}
I'd like to provide an update on this as of VS Code v1.28.2., markdownlint v0.21.0.
Per the official documentation, to provide a custom configuration, you simply put a .markdownlint.json
at the root directory of your project.
For example, consider the following folder structure:
.
│ .markdownlint.json
├───docs
│ sitesetup.md
└───src
and now consider the following content in .markdownlint.json
:
{
"default": true,
"MD007": false
}
VS Code would now load that custom markdownlint configuration when editing any markdown files within that folder hierarchy.
You can find the official documentation here.
.markdownlint.yaml
or .markdownlint.yml
. The avantage is you'll be able to add comments on why some rule was disabled (YAML supports comments whereas JSON does not)
Nov 21, 2019 at 9:37
.markdownlint.jsonc
(JSON with Comments.
Sep 17, 2021 at 10:45
.json
or .jsonc
in VS Code is full IntelliSense - very handy for working with configs like this.
Sep 17, 2021 at 10:53
With markdownlint 0.29, I wasn't able to get this working by using the rule name. On the documentation, there's an alias that I had to use instead, ul-indent
. My settings.json file ended up looking like:
{
"git.autofetch": true,
"markdownlint.config": {
"default": true,
"no-inline-html": { "allowed_elements": ["pre"] },
"ul-indent": { "indent": 4 }
}
}