VOOZH about

URL: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownLint

⇱ Markdown Lint - Visual Studio Marketplace


Skip to content
👁 Image
Sign in
Visual Studio>Tools>Markdown Lint
👁 Markdown Lint

Markdown Lint

Markdown linting extension for Visual Studio. Provides lint warnings and errors for markdown files based on markdownlint rules (MD001-MD058). Configure rules via .editorconfig files.

Markdown Lint for Visual Studio

👁 Build
👁 GitHub Sponsors

A powerful Visual Studio extension that brings real-time Markdown linting to your editor, based on the popular markdownlint rules (MD001-MD062).

Features

Real-time linting - See issues as you type with squiggly underlines
Error List integration - All warnings appear in Visual Studio's Error List
Quick fixes - Press Ctrl+. for automatic fixes (light bulb suggestions)
Fix All support - Fix all violations of a rule or all auto-fixable issues at once
Inline suppression - Suppress rules with <!-- markdownlint-disable-line --> comments
Format Document - Auto-fix all issues via Format Document (Ctrl+K, Ctrl+D)
Lint Folder/Solution - Lint all Markdown files in a folder, project, or solution
EditorConfig support - Configure rules per-project using .editorconfig files
Options page - Toggle rules on/off via Tools → Options → Markdown Lint → Rules
Context menu - Quick access to enable/disable linting and settings
50+ rules - Comprehensive coverage based on markdownlint standards (MD001-MD062)
Works with any Markdown editor - Including the built-in Markdown editor and most Markdown extensions

Installation

  1. Open Visual Studio 2022
  2. Go to ExtensionsManage Extensions
  3. Search for "Markdown Lint"
  4. Click Download and restart Visual Studio

Or download directly from the Visual Studio Marketplace.

Getting Started

Once installed, the extension works automatically on any .md file. It is compatible with both the built-in Markdown editor in Visual Studio and the Markdown Editor v2 extension.

  1. Open a Markdown file
  2. Linting issues appear as squiggly underlines
  3. Hover over issues to see the rule description
  4. Press Ctrl+. on an issue to see available quick fixes
  5. Check the Error List (Ctrl+\, E) for all issues in the document

Context Menu

Right-click in any Markdown file to access the Markdown Lint submenu:

  • Enabled - Toggle linting on/off (checkmark indicates current state)
  • Settings... - Open the Rules options page directly

Lint Folder / Solution

Right-click on any folder, project, or solution in Solution Explorer to lint all Markdown files:

  • Lint Markdown Files - Lint all .md files in the selected folder or project
  • Lint All Markdown Files - Lint all .md files in the entire solution

Open Folder mode: When using Visual Studio's Open Folder feature (without a solution), right-click on any folder or file in the Folder View to lint all Markdown files in that location.

Results appear in the Error List window, with clickable entries to navigate directly to issues. Files are processed in parallel for fast performance. The error list is automatically cleared when you close the solution or folder.

Ignored folders: By default, common folders like node_modules, vendor, .git, bin, and obj are automatically ignored. You can customize this list in Tools → Options → Markdown Lint → General → Ignored Folders.

.markdownlintignore support: Create a .markdownlintignore file in your project root to exclude additional files or patterns (uses .gitignore syntax).

Format Document

Use Format Document (Ctrl+K, Ctrl+D) or Format Selection (Ctrl+K, Ctrl+F) to automatically fix all auto-fixable violations. The first time you use this feature, you'll be prompted to enable or disable automatic fixing on format commands. You can change this setting later in Tools → Options → Markdown Lint → General.

Configuration

Rules can be configured in two ways:

  1. Options Page - Configure general settings and toggle rules via Tools → Options → Markdown Lint
  2. EditorConfig - Configure rules per-project using .editorconfig files

EditorConfig settings take precedence over the Options page. If no EditorConfig rule exists for a specific rule, the Options page setting is used.

General Options

Go to Tools → Options → Markdown Lint → General to configure:

Setting Description
Linting Enabled Enable or disable all markdown linting
Format Document Behavior Control auto-fixing on Format Document/Selection (Ask, On, Off)
Ignored Folders Comma-separated list of folders to ignore when linting (default: node_modules, vendor, .git, bin, obj, packages, TestResults)

Rules Options

Go to Tools → Options → Markdown Lint → Rules to access all rule settings organized by category:

Category Rules
1. Headings MD001, MD003, MD018-MD026, MD041
2. Lists MD004, MD005, MD007, MD029, MD030, MD032
3. Whitespace MD009, MD010, MD012, MD013, MD047
4. Code Blocks MD014, MD031, MD040, MD046, MD048
5. Links MD011, MD034, MD039, MD042, MD045, MD051-MD054, MD061, MD062
6. Inline MD033, MD035-MD038, MD049, MD050
7. Blockquotes MD027, MD028
8. Tables MD055, MD056, MD058, MD060
9. Accessibility MD059

Changes take effect immediately when you click OK or Apply - all open markdown files are automatically revalidated.

EditorConfig

Rules can also be configured in your .editorconfig file. All rules use the md_ prefix.

💡 Tip: Install the EditorConfig Language Service extension to get IntelliSense and validation for markdown lint rules in your .editorconfig files.

Example .editorconfig

[*.md]
# Disable trailing spaces rule
md_no_trailing_spaces = false

# Set line length to 120 characters
md_line_length = 120

# Change severity to error
md_no_hard_tabs = true:error

# Change severity to suggestion
md_no_multiple_blanks = true:suggestion

# Use specific heading style with warning severity
md_heading_style = atx:warning

Severity Levels

Severity is specified after the value using a colon: rule = value:severity

md_no_trailing_spaces = true:error
md_line_length = 120:suggestion
md_heading_style = atx:warning

The default severity for all rules is warning.

Available severity levels:

  • error - Shown as error (red squiggle)
  • warning - Shown as warning (green squiggle) [default]
  • suggestion - Shown as suggestion/hint (gray dots)
  • silent - Rule runs but doesn't report
  • none - Rule is disabled

To disable a rule entirely, set the value to false:

md_no_trailing_spaces = false

Available Rules

Rule Documentation

For detailed documentation on each rule, see the markdownlint Rules Documentation.

Quick Fixes

The extension provides intelligent quick fixes (Ctrl+.) for many common issues:

Rule Quick Fix
MD004 Change list marker style
MD009 Remove trailing whitespace
MD010 Replace tabs with spaces
MD011 Fix reversed link syntax
MD012 Remove extra blank lines
MD014 Remove dollar signs from commands
MD018 Add space after heading hash
MD019/MD021/MD027 Normalize multiple spaces
MD020 Add space inside closed atx heading
MD022/MD031/MD032/MD058 Add blank lines around elements
MD023 Remove leading whitespace from headings
MD026 Remove trailing punctuation
MD028 Add blockquote prefix
MD029 Fix ordered list prefix
MD030 Normalize list marker spacing
MD034 Wrap bare URLs in angle brackets
MD035 Change horizontal rule style
MD037 Remove spaces in emphasis
MD038 Remove spaces in code spans
MD039 Remove spaces in link text
MD040 Add language identifier to code blocks
MD045 Add alt text placeholder to images
MD047 Add/remove trailing newline
MD048 Change code fence style
MD049 Change emphasis style
MD050 Change strong/bold style
MD055 Add leading and trailing pipes
MD056 Fix table delimiter row

Fix All Actions

Right-click on any fixable issue to access bulk fix options:

  • Fix all [rule] violations in document - Fix all instances of a specific rule
  • Convert all [style] to [target] style - Normalize emphasis, strong, or list marker style across the entire document
  • Fix all auto-fixable violations in document - Fix all auto-fixable issues at once

Inline Suppression

Suppress specific rules directly in your Markdown files using HTML comments, compatible with the standard markdownlint suppression syntax.

Suppressing Errors

There are multiple ways to suppress an error:

  1. From QuickInfo - Hover over an error and click the "Suppress in code" link
  2. From Error List - Right-click an error in the Error List and select "Suppress in code"
  3. Manually - Type <!-- markdownlint-disable-line --> and use IntelliSense to add rule codes

Suppression Comment Syntax

<!-- markdownlint-disable-line MD013 -->
This line is excluded from the MD013 (line length) rule.

<!-- markdownlint-disable-line MD013 MD033 -->
This line is excluded from multiple rules.

<!-- markdownlint-disable MD013 -->
All lines below are excluded from MD013...
<!-- markdownlint-enable MD013 -->

<!-- markdownlint-disable-next-line MD041 -->
The next line is excluded from MD041.

<!-- markdownlint-disable-file MD013 -->
The entire file is excluded from MD013.

IntelliSense Support

When typing suppression comments, IntelliSense provides:

  • Rule code completion - Type MD to see all available rule codes (MD001, MD003, etc.)
  • Rule name completion - Type the rule name like heading-increment or line-length
  • QuickInfo tooltips - Hover over rule codes in suppression comments to see the rule description

Supported Directives

Directive Description
disable-line Suppress rules on the current line
disable-next-line Suppress rules on the next line
disable / enable Suppress rules for a block of lines
disable-file Suppress rules for the entire file
capture / restore Save and restore suppression state

Contributing

Found a bug or have a feature request? Please open an issue on GitHub.

License

This extension is open source. See the LICENSE file for details.