### Install markdownlint-cli2 with Homebrew
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
Install markdownlint-cli2 globally using Homebrew.
```bash
brew install markdownlint-cli2
```
--------------------------------
### Install markdownlint-cli2-formatter-sarif
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-sarif/README.md
Install the formatter as a development dependency using npm.
```bash
npm install markdownlint-cli2-formatter-sarif --save-dev
```
--------------------------------
### Install markdownlint-cli2-formatter-pretty
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-pretty/README.md
Install the package as a development dependency using npm.
```bash
npm install markdownlint-cli2-formatter-pretty --save-dev
```
--------------------------------
### Install markdownlint-cli2-formatter-summarize
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-summarize/README.md
Install this package as a development dependency using npm.
```bash
npm install markdownlint-cli2-formatter-summarize --save-dev
```
--------------------------------
### Example Output: Summarize by File
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-summarize/README.md
This is an example of the output when summarizing linting counts by file.
```text
Count File
3 dir/about.md
5 dir/subdir/info.md
5 viewme.md
13 [Total]
```
--------------------------------
### Example Output: Summarize by Rule and File
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-summarize/README.md
This is an example of the output when summarizing linting counts by rule and then by file.
```text
MD009/no-trailing-spaces
Count File
1 viewme.md
1 [Total]
MD012/no-multiple-blanks
Count File
1 dir/subdir/info.md
1 viewme.md
2 [Total]
MD019/no-multiple-space-atx
Count File
1 viewme.md
1 [Total]
MD021/no-multiple-space-closed-atx
Count File
1 dir/about.md
1 [Total]
MD022/blanks-around-headings/blanks-around-headers
Count File
1 dir/subdir/info.md
1 [Total]
MD025/single-title/single-h1
Count File
1 viewme.md
1 [Total]
MD029/ol-prefix
Count File
1 dir/about.md
1 [Total]
MD032/blanks-around-lists
Count File
1 dir/about.md
1 [Total]
MD038/no-space-in-code
Count File
2 dir/subdir/info.md
2 [Total]
MD041/first-line-heading/first-line-h1
Count File
1 dir/subdir/info.md
1 [Total]
MD047/single-trailing-newline
Count File
1 viewme.md
1 [Total]
```
--------------------------------
### Install markdownlint-cli2 Globally
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
Install markdownlint-cli2 as a global command-line tool using npm.
```bash
npm install markdownlint-cli2 --global
```
--------------------------------
### Install markdownlint-cli2-formatter-template
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-template/README.md
Install the package as a development dependency using npm.
```bash
npm install markdownlint-cli2-formatter-template --save-dev
```
--------------------------------
### Install markdownlint-cli2-formatter-junit
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-junit/README.md
Install the package as a development dependency using npm.
```bash
npm install markdownlint-cli2-formatter-junit --save-dev
```
--------------------------------
### Example Output: Summarize by File and Rule
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-summarize/README.md
This is an example of the output when summarizing linting counts by file and then by rule.
```text
dir/about.md
Count Rule
1 MD021/no-multiple-space-closed-atx
1 MD029/ol-prefix
1 MD032/blanks-around-lists
3 [Total]
dir/subdir/info.md
Count Rule
1 MD012/no-multiple-blanks
1 MD022/blanks-around-headings/blanks-around-headers
2 MD038/no-space-in-code
1 MD041/first-line-heading/first-line-h1
5 [Total]
viewme.md
Count Rule
1 MD009/no-trailing-spaces
1 MD012/no-multiple-blanks
1 MD019/no-multiple-space-atx
1 MD025/single-title/single-h1
1 MD047/single-trailing-newline
5 [Total]
```
--------------------------------
### Example markdownlint-cli2.jsonc Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
This is an example of a markdownlint-cli2 configuration file in JSONC format. Settings apply to the directory it is in and all subdirectories, merging with parent configurations.
```json
{
"extends": "./.markdownlint.jsonc",
"plugins": [
"markdownlint-plugin-example"
],
"outputFormatters": [
["pretty", {"indent": 2}]
],
"showFound": true
}
```
--------------------------------
### Install markdownlint-cli2-formatter-codequality
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-codequality/README.md
Install the package as a development dependency using npm.
```bash
npm install markdownlint-cli2-formatter-codequality --save-dev
```
--------------------------------
### Example Output: Summarize by Rule
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-summarize/README.md
This is an example of the output when summarizing linting counts by rule.
```text
Count Rule
1 MD009/no-trailing-spaces
2 MD012/no-multiple-blanks
1 MD019/no-multiple-space-atx
1 MD021/no-multiple-space-closed-atx
1 MD022/blanks-around-headings/blanks-around-headers
1 MD025/single-title/single-h1
1 MD029/ol-prefix
1 MD032/blanks-around-lists
2 MD038/no-space-in-code
1 MD041/first-line-heading/first-line-h1
1 MD047/single-trailing-newline
13 [Total]
```
--------------------------------
### Install markdownlint-cli2-formatter-json
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-json/README.md
Install the package as a development dependency using npm.
```bash
npm install markdownlint-cli2-formatter-json --save-dev
```
--------------------------------
### Inline Code Example
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/test/showFound/dir/subdir2/info.md
This shows inline code usage within text. No specific setup is required for inline code.
```markdown
` code1`
```
```markdown
`code2 `
```
--------------------------------
### Example package.json Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
Demonstrates how markdownlint-cli2 configuration can be nested within a package.json file. This configuration can be accessed using the --configPointer argument.
```json
{
"...": "...",
"markdownlint-cli2": {
"config": {
"no-multiple-blanks": false
},
"noProgress": true
}
}
```
--------------------------------
### Example markdownlint-cli2.yaml Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
This is an example of a markdownlint-cli2 configuration file in YAML format. It follows the same structure as JSONC and has similar scope and merging behavior.
```yaml
extends: ./.markdownlint.yaml
plugins:
- markdownlint-plugin-example
outputFormatters:
- - pretty
- indent: 2
showFound: true
```
--------------------------------
### Example markdownlint.jsonc Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
This is an example of a markdownlint configuration file in JSONC format. Settings override parent configurations and can be extended using the 'extends' property.
```json
{
"extends": "./node_modules/my-config/markdownlint.jsonc",
"no-duplicate-header": false,
"MD001": false
}
```
--------------------------------
### Install markdownlint-cli2-formatter-default
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-default/README.md
Install the package as a development dependency using npm.
```bash
npm install markdownlint-cli2-formatter-default --save-dev
```
--------------------------------
### Example markdownlint.yaml Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
This is an example of a markdownlint configuration file in YAML format. It mirrors the structure of JSONC files and supports the same 'extends' property for configuration merging.
```yaml
extends: ./node_modules/my-config/markdownlint.yaml
no-duplicate-header: false
MD001: false
```
--------------------------------
### Template Examples for markdownlint-cli2
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-template/README.md
Demonstrates different template syntaxes for formatting linting violations, including handling defined and undefined tokens.
```plaintext
Column=${columnNumber}
```
```plaintext
${columnNumber:Column=${columnNumber}}
```
```plaintext
${columnNumber!No column number}
```
```plaintext
${columnNumber:Column=${columnNumber}}${columnNumber!No column number}
```
--------------------------------
### Example markdownlint-cli2.mjs Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
This is an example of a markdownlint-cli2 configuration file using ECMAScript module format. Similar to .cjs, it allows direct export of configuration objects or functions, and can also export Promises.
```javascript
export default {
extends: './.markdownlint.mjs',
plugins: [
import('markdownlint-plugin-example')
],
outputFormatters: [
['pretty', { indent: 2 }]
],
showFound: true
};
```
--------------------------------
### Example markdownlint-cli2.cjs Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
This is an example of a markdownlint-cli2 configuration file using CommonJS module format. It allows direct export of configuration objects or functions, and can also export Promises.
```javascript
module.exports = {
extends: './.markdownlint.cjs',
plugins: [
require('markdownlint-plugin-example')
],
outputFormatters: [
['pretty', { indent: 2 }]
],
showFound: true
};
```
--------------------------------
### Install markdownlint-cli2 via Docker
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
Pull the markdownlint-cli2 Docker container image.
```bash
docker pull davidanson/markdownlint-cli2
```
--------------------------------
### Example markdownlint.mjs Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
This is an example of a markdownlint configuration file using ECMAScript module format. It exports the markdownlint config object directly or as a Promise.
```javascript
export default {
extends: './node_modules/my-config/markdownlint.mjs',
'no-duplicate-header': false,
'MD001': false
};
```
--------------------------------
### Example GitHub Actions Output
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-template/README.md
This is an example of the output produced when the GitHub Actions formatter is enabled. It shows the format of individual linting errors and warnings.
```text
::error file=viewme.md,line=3,col=10,title=MD009/no-trailing-spaces::Trailing spaces
::warning file=viewme.md,line=5,title=MD012/no-multiple-blanks::Multiple consecutive blank lines
::error file=viewme.md,line=6,title=MD025/single-title/single-h1::Multiple top-level headings in the same document
::error file=viewme.md,line=12,col=4,title=MD019/no-multiple-space-atx::Multiple spaces after hash on atx style heading
::warning file=viewme.md,line=14,col=14,title=MD047/single-trailing-newline::Files should end with a single newline character
```
--------------------------------
### Example Azure Pipelines Output
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-template/README.md
This is an example of the output produced when the Azure Pipelines formatter is enabled. It demonstrates the format for logging issues within Azure Pipelines.
```text
##vso[task.logissue type=error;sourcepath=viewme.md;linenumber=3;columnumber=10;code=MD009/no-trailing-spaces]Trailing spaces
##vso[task.logissue type=warning;sourcepath=viewme.md;linenumber=5;code=MD012/no-multiple-blanks]Multiple consecutive blank lines
##vso[task.logissue type=error;sourcepath=viewme.md;linenumber=6;code=MD025/single-title/single-h1]Multiple top-level headings in the same document
##vso[task.logissue type=error;sourcepath=viewme.md;linenumber=12;columnumber=4;code=MD019/no-multiple-space-atx]Multiple spaces after hash on atx style heading
##vso[task.logissue type=warning;sourcepath=viewme.md;linenumber=14;columnumber=14;code=MD047/single-trailing-newline]Files should end with a single newline character
```
--------------------------------
### Example markdownlint-cli2 output
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-default/README.md
This is an example of the output produced by the default formatter, showing linting errors and warnings with file paths, line numbers, and error codes.
```text
dir/about.md:1:3 error MD021/no-multiple-space-closed-atx Multiple spaces inside hashes on closed atx style heading [Context: "# About #"]
dir/about.md:1:10 error MD021/no-multiple-space-closed-atx Multiple spaces inside hashes on closed atx style heading [Context: "# About #"]
dir/about.md:4 error MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "1. List"]
dir/about.md:5:1 error MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 3; Style: 1/2/3]
dir/subdir/info.md:1 error MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Information"]
dir/subdir/info.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "## Information"]
dir/subdir/info.md:2:7 error MD038/no-space-in-code Spaces inside code span elements [Context: "` code1`"]
dir/subdir/info.md:2:26 error MD038/no-space-in-code Spaces inside code span elements [Context: "`code2 `"]
dir/subdir/info.md:4 error MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
viewme.md:3:10 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
viewme.md:5 warning MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
viewme.md:6 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Description"]
viewme.md:12:4 error MD019/no-multiple-space-atx Multiple spaces after hash on atx style heading [Context: "## Summary"]
viewme.md:14:14 warning MD047/single-trailing-newline Files should end with a single newline character
```
--------------------------------
### Configuration File - JavaScript (CJS/MJS)
Source: https://context7.com/davidanson/markdownlint-cli2/llms.txt
Examples of dynamic configuration files using CommonJS (.cjs) and ES Modules (.mjs) for markdownlint-cli2.
```APIDOC
## Configuration File - JavaScript (CJS/MJS)
For dynamic configuration needs, use `.markdownlint-cli2.cjs` (CommonJS) or `.markdownlint-cli2.mjs` (ES modules). This allows programmatic configuration and direct function references.
### .markdownlint-cli2.cjs (CommonJS)
```javascript
"use strict";
const customRule = require("./custom-rules/my-rule");
module.exports = {
config: {
default: true,
MD013: { line_length: 120 },
MD033: false
},
// Pass rule objects directly instead of module names
customRules: [customRule],
fix: process.env.CI !== "true",
ignores: [
"**/node_modules/**",
process.env.SKIP_DOCS ? "docs/**" : ""
].filter(Boolean),
globs: ["**/*.md"],
noBanner: true,
noProgress: true
};
```
### .markdownlint-cli2.mjs (ES module)
```javascript
import customRule from "./custom-rules/my-rule.mjs";
export default {
config: {
default: true,
MD013: { line_length: 100 }
},
customRules: [customRule],
fix: false,
ignores: ["**/node_modules/**"]
};
```
```
--------------------------------
### Inline Code Example
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/test/noInlineConfig/dir/subdir/info.md
Demonstrates inline code usage within documentation text. This is a basic representation of code as text.
```text
code1
```
```text
code2
```
--------------------------------
### JSON Configuration for Output Formatters
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/doc/OutputFormatters.md
Example of how to configure output formatters in a .markdownlint-cli2.jsonc file, specifying the formatter package and its parameters.
```json
{
"outputFormatters": [
[ "markdownlint-cli2-formatter-json", { "name": "custom-name.json", "spaces": 1 } ]
]
}
```
--------------------------------
### Clean Output Formatter Example
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/test/snapshots/markdownlint-cli2-test-exec.mjs.md
Demonstrates the output of the clean formatter when no errors are found. This includes exit code, and empty or structured formatter outputs.
```javascript
{
exitCode: 0,
formatterCodeQuality: '[]',
formatterJson: '[]',
formatterJunit: `␊
␊
`,
formatterSarif: `{
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
"version": "2.1.0",
"runs": [
{
"tool": {
"driver": {
"name": "markdownlint-cli2",
"version": "0.0.4",
"informationUri": "https://github.com/DavidAnson/markdownlint-cli2",
"rules": []
}
},
"results": []
}
]
}`,
stderr: '',
stdout: `markdownlint-cli2 vX.Y.Z (markdownlint vX.Y.Z)␊
Finding: **/*.md␊
Linting: 0 file(s)␊
Summary: 0 error(s)`
}
```
--------------------------------
### Install markdownlint-cli2 as a Dev Dependency
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
Install markdownlint-cli2 as a development dependency for your Node.js project using npm.
```bash
npm install markdownlint-cli2 --save-dev
```
--------------------------------
### Example JSON Output
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-json/README.md
This is an example of the JSON output generated by the formatter, detailing linting errors and warnings.
```json
[
{
"fileName": "viewme.md",
"lineNumber": 3,
"ruleNames": [
"MD009",
"no-trailing-spaces"
],
"ruleDescription": "Trailing spaces",
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.20.4/doc/Rules.md#md009",
"errorDetail": "Expected: 0 or 2; Actual: 1",
"errorContext": null,
"errorRange": [
10,
1
],
"fixInfo": {
"editColumn": 10,
"deleteCount": 1
},
"severity": "error"
},
{
"fileName": "viewme.md",
"lineNumber": 5,
"ruleNames": [
"MD012",
"no-multiple-blanks"
],
"ruleDescription": "Multiple consecutive blank lines",
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.20.4/doc/Rules.md#md012",
"errorDetail": "Expected: 1; Actual: 2",
"errorContext": null,
"errorRange": null,
"fixInfo": {
"deleteCount": -1
},
"severity": "warning"
},
{
"fileName": "viewme.md",
"lineNumber": 6,
"ruleNames": [
"MD025",
"single-title",
"single-h1"
],
"ruleDescription": "Multiple top-level headings in the same document",
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.20.4/doc/Rules.md#md025",
"errorDetail": null,
"errorContext": "# Description",
"errorRange": null,
"fixInfo": null,
"severity": "error"
},
{
"fileName": "viewme.md",
"lineNumber": 12,
"ruleNames": [
"MD019",
"no-multiple-space-atx"
],
"ruleDescription": "Multiple spaces after hash on atx style heading",
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.20.4/doc/Rules.md#md019",
"errorDetail": null,
"errorContext": "## Summary",
"errorRange": [
1,
5
],
"fixInfo": {
"editColumn": 3,
"deleteCount": 1
},
"severity": "error"
},
{
"fileName": "viewme.md",
"lineNumber": 14,
"ruleNames": [
"MD047",
"single-trailing-newline"
],
"ruleDescription": "Files should end with a single newline character",
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.20.4/doc/Rules.md#md047",
"errorDetail": null,
"errorContext": null,
"errorRange": [
14,
1
],
"fixInfo": {
"editColumn": 15,
"insertText": "\n"
},
"severity": "warning"
}
]
```
--------------------------------
### Example JUnit XML Output
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-junit/README.md
This is an example of the JUnit XML output generated by the formatter. Only errors are included.
```xml
>
>
```
--------------------------------
### Example markdownlint.cjs Configuration
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
This is an example of a markdownlint configuration file using CommonJS module format. It exports the markdownlint config object directly or as a Promise.
```javascript
module.exports = {
extends: './node_modules/my-config/markdownlint.cjs',
'no-duplicate-header': false,
'MD001': false
};
```
--------------------------------
### Configure Markdownlint Rules
Source: https://context7.com/davidanson/markdownlint-cli2/llms.txt
Configure individual markdownlint rules using a .markdownlint.jsonc file. This example demonstrates enabling all rules by default, disabling specific rules, configuring rules with options, and extending from another configuration file.
```jsonc
// .markdownlint.jsonc - Rule-only configuration
{
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json",
// Enable all rules by default
"default": true,
// Disable specific rules
"MD013": false,
"no-hard-tabs": false,
// Configure rules with options
"MD003": {
"style": "atx"
},
"MD004": {
"style": "dash"
},
"MD007": {
"indent": 2
},
"MD009": {
"br_spaces": 2
},
"MD012": {
"maximum": 2
},
"MD024": {
"siblings_only": true
},
"MD033": {
"allowed_elements": ["br", "details", "summary", "sup", "sub"]
},
"MD035": {
"style": "---"
},
"MD046": {
"style": "fenced"
},
"MD048": {
"style": "backtick"
},
// Extend from another configuration
"extends": "./base-config.json"
}
```
--------------------------------
### Configure Summarize by Rule and File
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-summarize/README.md
Use this configuration to summarize linting counts by rule and then by file. Add this to your .markdownlint-cli2.jsonc file.
```json
{
"outputFormatters": [
[ "markdownlint-cli2-formatter-summarize", { "byRuleByFile": true } ]
]
}
```
--------------------------------
### Missing File Output Formatter Example
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/test/snapshots/markdownlint-cli2-test-exec.mjs.md
Shows the output when the specified file pattern does not match any files. The exit code is 2, indicating a configuration or file-finding issue.
```javascript
{
exitCode: 2,
formatterCodeQuality: '',
formatterJson: '',
formatterJunit: '',
formatterSarif: '',
stdout: `markdownlint-cli2 vX.Y.Z (markdownlint vX.Y.Z)␊
Finding: .*␊
Linting: 1 file(s)␊
Summary: 0 error(s)`
}
```
--------------------------------
### Configure Summarize by File and Rule
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-summarize/README.md
Use this configuration to summarize linting counts by file and then by rule. Add this to your .markdownlint-cli2.jsonc file.
```json
{
"outputFormatters": [
[ "markdownlint-cli2-formatter-summarize", { "byFileByRule": true } ]
]
}
```
--------------------------------
### Example GitLab Code Quality Report Output
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-codequality/README.md
An example of the JSON output generated by the markdownlint-cli2-formatter-codequality formatter, conforming to the GitLab Code Quality report format.
```json
[
{
"type": "issue",
"check_name": "MD009/no-trailing-spaces",
"description": "MD009/no-trailing-spaces: Trailing spaces [Expected: 0 or 2; Actual: 1]",
"severity": "minor",
"fingerprint": "f34a01e4a119d7df262993933665d4c97cc601702eeca2814ccad9606a3ccb48",
"location": {
"path": "viewme.md",
"lines": {
"begin": 3
}
}
},
{
"type": "issue",
"check_name": "MD012/no-multiple-blanks",
"description": "MD012/no-multiple-blanks: Multiple consecutive blank lines [Expected: 1; Actual: 2]",
"severity": "minor",
"fingerprint": "a3d9b647ce8d929904e64fbbb0a47223617e8985d0a4d31e674b22f919f736fb",
"location": {
"path": "viewme.md",
"lines": {
"begin": 5
}
}
},
{
"type": "issue",
"check_name": "MD025/single-title/single-h1",
"description": "MD025/single-title/single-h1: Multiple top-level headings in the same document",
"severity": "minor",
"fingerprint": "ef26889ac26be010b8bb6d2bd8c846c70bccf90506c0adffb763bef774f93f80",
"location": {
"path": "viewme.md",
"lines": {
"begin": 6
}
}
},
{
"type": "issue",
"check_name": "MD019/no-multiple-space-atx",
"description": "MD019/no-multiple-space-atx: Multiple spaces after hash on atx style heading",
"severity": "minor",
"fingerprint": "244fe04169875709c7854fc0ddef5c2639aa57bad8a9319e3a9ed6a5f8504c89",
"location": {
"path": "viewme.md",
"lines": {
"begin": 12
}
}
},
{
"type": "issue",
"check_name": "MD047/single-trailing-newline",
"description": "MD047/single-trailing-newline: Files should end with a single newline character",
"severity": "minor",
"fingerprint": "bf74eade0ee3301ccaa826907651e0d6925b60d517e1110c29b081c7b6ce1acf",
"location": {
"path": "viewme.md",
"lines": {
"begin": 14
}
}
}
]
```
--------------------------------
### Basic Command Line Execution
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/README.md
Execute markdownlint-cli2 with glob expressions to specify files for linting. Ensure glob expressions are quoted for cross-platform compatibility.
```bash
markdownlint-cli2 "**/*.md" "#node_modules"
```
--------------------------------
### Configure Summarize by File
Source: https://github.com/davidanson/markdownlint-cli2/blob/main/formatter-summarize/README.md
Use this configuration to summarize linting counts by file. Add this to your .markdownlint-cli2.jsonc file.
```json
{
"outputFormatters": [
[ "markdownlint-cli2-formatter-summarize", { "byFile": true } ]
]
}
```