# markdownlint-cli2-formatter-junit

> An output formatter for markdownlint-cli2 that writes results to a file in JUnit XML format

Latest version **0.0.14** (published 2025-11-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdownlint-cli2-formatter-junit
pnpm add markdownlint-cli2-formatter-junit
yarn add markdownlint-cli2-formatter-junit
bun add markdownlint-cli2-formatter-junit
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2025-11-01 |
| First published | 2020-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 913 |
| Author | David Anson |
| Maintainers | davidanson |
| Keywords | markdownlint-cli2-formatter |

## Links

- npm: https://www.npmjs.com/package/markdownlint-cli2-formatter-junit
- Repository: https://github.com/DavidAnson/markdownlint-cli2
- Issues: https://github.com/DavidAnson/markdownlint-cli2/issues
- Funding: https://github.com/sponsors/DavidAnson
- npm.io page: https://npm.io/package/markdownlint-cli2-formatter-junit

## Dependencies (1)

- [junit-report-builder](https://npm.io/package/junit-report-builder.md) 5.1.1

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.0.14 (latest) — 2025-11-01
- 0.0.13 — 2025-05-10
- 0.0.12 — 2024-09-06
- 0.0.11 — 2024-08-02
- 0.0.10 — 2024-07-27
- 0.0.9 — 2024-02-04
- 0.0.8 — 2023-11-16
- 0.0.7 — 2023-08-24
- 0.0.6 — 2023-03-25
- 0.0.5 — 2022-03-01
- 0.0.4 — 2022-01-16
- 0.0.3 — 2021-02-27
- 0.0.2 — 2020-12-20
- 0.0.1 — 2020-08-11

## README

# markdownlint-cli2-formatter-junit

> An output formatter for [`markdownlint-cli2`][markdownlint-cli2] that writes
> results to a file in [JUnit XML format][junit-format]

[![npm version][npm-image]][npm-url]
[![License][license-image]][license-url]

## Install

```bash
npm install markdownlint-cli2-formatter-junit --save-dev
```

## Use

For the default output file name of `"markdownlint-cli2-junit.xml"`, use
the following `.markdownlint-cli2.jsonc`:

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

To customize the output file name, use the following `.markdownlint-cli2.jsonc`:

```json
{
  "outputFormatters": [
    [ "markdownlint-cli2-formatter-junit", { "name": "custom-name.xml" } ]
  ]
}
```

Because the JUnit XML format only supports errors, results with a `severity`
other than `error` (e.g., `warning`) are not included in the output.

## Example

```xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="markdownlint-cli2-formatter-junit" time="0" tests="5" failures="5" errors="0" skipped="0">
    <testcase classname="viewme.md" name="MD009/no-trailing-spaces" time="0">
      <failure message="Trailing spaces">
        <![CDATA[Line 3, Column 10, Expected: 0 or 2; Actual: 1]]>
      </failure>
    </testcase>
    <testcase classname="viewme.md" name="MD012/no-multiple-blanks" time="0">
      <failure message="Multiple consecutive blank lines">
        <![CDATA[Line 5, Expected: 1; Actual: 2]]>
      </failure>
    </testcase>
    <testcase classname="viewme.md" name="MD025/single-title/single-h1" time="0">
      <failure message="Multiple top-level headings in the same document">
        <![CDATA[Line 6, Context: "# Description"]]>
      </failure>
    </testcase>
    <testcase classname="viewme.md" name="MD019/no-multiple-space-atx" time="0">
      <failure message="Multiple spaces after hash on atx style heading">
        <![CDATA[Line 12, Column 1, Context: "##  Summary"]]>
      </failure>
    </testcase>
    <testcase classname="viewme.md" name="MD047/single-trailing-newline" time="0">
      <failure message="Files should end with a single newline character">
        <![CDATA[Line 14, Column 14]]>
      </failure>
    </testcase>
  </testsuite>
</testsuites>
```

[junit-format]: https://github.com/testmoapp/junitxml
[license-image]: https://img.shields.io/npm/l/markdownlint-cli2-formatter-junit.svg
[license-url]: https://opensource.org/licenses/MIT
[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2
[npm-image]: https://img.shields.io/npm/v/markdownlint-cli2-formatter-junit.svg
[npm-url]: https://www.npmjs.com/package/markdownlint-cli2-formatter-junit

---
_Source: https://npm.io/package/markdownlint-cli2-formatter-junit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
