← 返回首页
markdownlint-cli2/formatter-json/README.md at main · DavidAnson/markdownlint-cli2 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Latest commit

 

History

History
147 lines (135 loc) · 3.52 KB
 main
Top

File metadata and controls

  • Preview
  • Code
  • Blame
147 lines (135 loc) · 3.52 KB

markdownlint-cli2-formatter-json

An output formatter for markdownlint-cli2 that writes results to a file in JSON format

Install

npm install markdownlint-cli2-formatter-json --save-dev

Use

For the default output file name of "markdownlint-cli2-results.json", use the following .markdownlint-cli2.jsonc:

{ "outputFormatters": [ [ "markdownlint-cli2-formatter-json" ] ] }

To customize the output file name or number of spaces to indent, use the following .markdownlint-cli2.jsonc:

{ "outputFormatters": [ [ "markdownlint-cli2-formatter-json", { "name": "custom-name.json", "spaces": 1 } ] ] }

Example

[ { "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" } ]

Footer

© 2026 GitHub, Inc.