Registry / testing / markdownlint-cli2-formatter-json

markdownlint-cli2-formatter-json

JSON →
library0.0.9jsnpmunverified

Output formatter for markdownlint-cli2 that writes lint results to a JSON file. Current version 0.0.9 is stable and in active development. This package, part of the markdownlint ecosystem, provides a simple, straightforward way to export markdownlint-cli2 results as structured JSON for programmatic consumption, CI systems, or integration with other tools. Unlike other formatters that output to stdout or other formats, this one exclusively writes to a file with customizable name and indentation. It requires markdownlint-cli2 >=0.0.4 as a peer dependency and is configured via the outputFormatters array in the markdownlint-cli2 configuration file.

npm install markdownlint-cli2-formatter-json
INSTALL
IMPORT
SIG · MARKDOWNLINT-CLI2-
M
markdownlint-cli2-formatter-json
testingjavascriptv0.0.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Installs the package, configures it as a formatter in .markdownlint-cli2.jsonc, and runs markdownlint-cli2 to produce a JSON output file.

// No direct JavaScript imports; this is a formatter for markdownlint-cli2 // Install: npm install markdownlint-cli2-formatter-json --save-dev // Configure in .markdownlint-cli2.jsonc: { "outputFormatters": [ [ "markdownlint-cli2-formatter-json", { "name": "results.json", "spaces": 2 } ] ] } // Then run: npx markdownlint-cli2 "**/*.md" // Output will be written to results.json as an array of lint result objects.
Debug
Known issues
gotchaOutput file is overwritten each run; no incremental/append mode.
fix
Ensure you want to overwrite; consider versioning output files externally.
affects: >=0.0.0
gotchaConfiguration must be in .markdownlint-cli2.jsonc (or .js, .yaml) in the project root, not in package.json or command line.
fix
Create the appropriate config file in the project root directory.
affects: >=0.0.0
deprecatedNo deprecated features in this version.
fix
N/A
affects: >=0.0.0
Errors
Common errors & fixes
Error: Could not find module 'markdownlint-cli2-formatter-json'
Package not installed or not in node_modules.
fix
Run npm install markdownlint-cli2-formatter-json --save-dev
Invalid config: Unexpected property 'outputFormatters'
Using a .json config file that doesn't support comments or using wrong format.
fix
Use .markdownlint-cli2.jsonc (JSON with comments) or .markdownlint-cli2.json if no comments.
Cannot read properties of undefined (reading 'outputFormatters')
Config file is empty or not valid JSON.
fix
Ensure config file contains valid JSON with an outputFormatters array.
Upgrade
Version history
0.0.9latest on npm
Audit
Dependencies
markdownlint-cli2requiredpeer dependency: runtime CLI tool that invokes the formatter
Agent activity
2 hits · last 30 days
node
2
Resources
markdownlint-cli2-formatter-json — npm install markdownlint-cli2-formatter-json · libregistry