Registry / devops / eslint-formatter-json-summary

eslint-formatter-json-summary

JSON →
library1.0.0jsnpmunverified

ESLint formatter that aggregates linting results by rule and outputs a JSON summary. Version 1.0.0 is stable, with no recent updates. It provides total errors and warnings per rule, and supports sorting by rule name, error count, or warning count via environment variables (SORT_BY, DESC). Use it to get a high-level overview of linting failures in large codebases, aiding in rule suppression decisions. It's an alternative to the default ESLint formatter for CI pipelines or analysis tools that consume JSON.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

This is an ESLint formatter, not typically imported directly. It's used via ESLint's -f flag. If used programmatically, it exports a function that takes ESLint results and returns JSON string.

import formatter from 'eslint-formatter-json-summary'

Shows how to install and use the formatter via CLI with sorting environment variables, and programmatically with ESLint API.

// Install // npm i -D eslint-formatter-json-summary // Run ESLint with this formatter // npx eslint -f json-summary src/ // To sort by errors descending: // SORT_BY=errors DESC=true npx eslint -f json-summary src/ // Programmatic usage: import { ESLint } from 'eslint'; import fs from 'fs'; const eslint = new ESLint(); const results = await eslint.lintFiles(['src/']); const formatter = await eslint.loadFormatter('json-summary'); const resultText = await formatter.format(results); console.log(resultText); // JSON string
Debug
Known footguns
gotchaThe formatter aggregates by rule but does not include file paths or line numbers for individual errors.
deprecatedThe package relies on environment variables SORT_BY and DESC for configuration; there is no programmatic API to set these.
gotchaIf using ESLint's --format flag, the formatter name must be 'json-summary', not the full package name.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
5 hits · last 30 days
gptbot
3
ahrefsbot
2
Resources