How do I change Markdownlint settings in Visual Studio Code

Solution 1:

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.

  1. In Visual Studio Code, open File -> Preferences -> Settings or use CTRL + ,

  2. Edit the User Settings tab on the right to something like this:

    "markdownlint.config": {
        "default": true,
        "MD007": { "indent": 4 }
    }
    

Solution 2:

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.

Solution 3:

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 }
    }
}