What is markdownlint-cli2-formatter-default?
The markdownlint-cli2-formatter-default package is a default formatter for markdownlint-cli2, a command-line interface for the markdownlint library. It provides a way to format the output of markdownlint in a human-readable manner, making it easier to understand and fix linting issues in Markdown files.
What are markdownlint-cli2-formatter-default's main functionalities?
Basic Formatting
This feature allows you to run markdownlint on all Markdown files in a directory and format the output using the default formatter. The command will lint the files and display the results in a readable format.
markdownlint-cli2 '**/*.md' --format markdownlint-cli2-formatter-default
Custom Configuration
This feature allows you to use a custom configuration file for markdownlint while still using the default formatter. The command specifies a custom configuration file (.markdownlint.json) to tailor the linting rules to your project's needs.
markdownlint-cli2 '**/*.md' --format markdownlint-cli2-formatter-default --config .markdownlint.json
Integration with CI/CD
This feature demonstrates how to integrate markdownlint with a CI/CD pipeline. The command runs markdownlint with the default formatter and provides feedback based on whether the linting passed or failed.
markdownlint-cli2 '**/*.md' --format markdownlint-cli2-formatter-default && echo 'Linting passed!' || echo 'Linting failed!'
Other packages similar to markdownlint-cli2-formatter-default
markdownlint-cli
markdownlint-cli is a command-line interface for the markdownlint library, similar to markdownlint-cli2. It provides linting capabilities for Markdown files but does not include a default formatter. Users need to handle the output formatting themselves or use additional tools.
remark-cli
remark-cli is a command-line interface for the remark library, which is a Markdown processor powered by plugins. It offers more flexibility and extensibility compared to markdownlint-cli2-formatter-default, as users can add various plugins to customize the linting and formatting process.
markdown-it
markdown-it is a Markdown parser that can be extended with plugins for various functionalities, including linting and formatting. While it is not a direct replacement for markdownlint-cli2-formatter-default, it provides a highly customizable environment for processing Markdown files.
markdownlint-cli2-formatter-default
An output formatter for markdownlint-cli2
that produces
the same output as markdownlint-cli

Install
npm install markdownlint-cli2-formatter-default --save-dev
Use
No action is necessary; this is the default output formatter for
markdownlint-cli2
.
To reference it directly in .markdownlint-cli2.jsonc
:
{
"outputFormatters": [
[ "markdownlint-cli2-formatter-default" ]
]
}
Example
dir/about.md:1:1 MD021/no-multiple-space-closed-atx Multiple spaces inside hashes on closed atx style heading [Context: "# About #"]
dir/about.md:4 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "1. List"]
dir/about.md:5:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 3; Style: 1/2/3]
dir/subdir/info.md:1 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Information"]
dir/subdir/info.md:1 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:6 MD038/no-space-in-code Spaces inside code span elements [Context: "` code1`"]
dir/subdir/info.md:2:20 MD038/no-space-in-code Spaces inside code span elements [Context: "`code2 `"]
dir/subdir/info.md:4 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
viewme.md:3:10 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
viewme.md:5 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
viewme.md:6 MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "# Description"]
viewme.md:12:1 MD019/no-multiple-space-atx Multiple spaces after hash on atx style heading [Context: "## Summary"]
viewme.md:14:14 MD047/single-trailing-newline Files should end with a single newline character