Registry / testing / eslint-formatter-compact

eslint-formatter-compact

JSON →
library9.0.1jsnpmunverified

Standalone ESLint compact formatter package republishing ESLint's built-in compact output format. Version 9.0.1 requires Node.js ^18.18.0 || ^20.9.0 || >=21.1.0. Ships TypeScript declarations. Released infrequently, mirrors ESLint's own formatter. No extra features vs. ESLint's built-in; useful for programmatic usage or when the built-in formatter is not available.

npm install eslint-formatter-compact
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-C
E
eslint-formatter-compact
testingjavascriptv9.0.1
harness data pending
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.

default
import eslintFormatterCompact from 'eslint-formatter-compact'
const eslintFormatterCompact = require('eslint-formatter-compact').default
Default export only; no named export. ESM/CJS compatible but requires default import.
FormatterFunction
import type { Linter } from 'eslint'; // formatter is (results: Linter.LintMessage[]) => string
import { FormatterFunction } from 'eslint-formatter-compact'
No type export from this package; import types from eslint.
CLI usage
eslint --format eslint-formatter-compact src/
eslint --format compact src/
Use the package name when the formatter is from an npm package, not the built-in alias.

Shows how to use the formatter programmatically with ESLint's API, including loading the formatter from the package.

import eslintFormatterCompact from 'eslint-formatter-compact'; import { ESLint } from 'eslint'; const engine = new ESLint(); const results = await engine.lintFiles(['src/']); const formatter = await engine.loadFormatter(eslintFormatterCompact); console.log(formatter.format(results));
Debug
Known issues
breakingThe package now requires Node.js 18+ as of v9.0.0.
fix
Upgrade Node.js to ^18.18.0 || ^20.9.0 || >=21.1.0.
affects: >=9.0.0
breakingRemoved support for CommonJS require() via index.js in v9.0.0; package is now ESM-only.
fix
Use import or dynamic import(). For CommonJS projects, use dynamic import e.g. const formatter = await import('eslint-formatter-compact').then(m => m.default);
affects: >=9.0.0
gotchaThis formatter does not output color/ANSI codes; output is plain text.
fix
For colored output, use the `stylish` formatter instead.
affects: all
gotchaThe formatter expects ESLint's LintResult[] format; using with older ESLint versions may cause errors.
fix
Ensure ESLint version matches the formatter's ESLint peer dependency (check package.json).
affects: >=9.0.0
Errors
Common errors & fixes
Cannot find module 'eslint-formatter-compact'
The package is not installed or Node.js resolution fails.
fix
Run npm install eslint-formatter-compact --save-dev
Error: Unable to load formatter 'eslint-formatter-compact'
ESLint CLI cannot find the formatter package.
fix
Ensure the formatter is installed and use correct path: --format eslint-formatter-compact
TypeError: formatter is not a function
Incorrect import; maybe using .default incorrectly.
fix
Use default import: import formatter from 'eslint-formatter-compact'
Upgrade
Version history
9.0.1latest on npm
Audit
Dependencies
eslintrequiredThis formatter is designed for ESLint; it uses ESLint's message format.
Agent activity
4 hits · last 30 days
node
4
Resources