Registry / testing / eslint-formatter-pretty

eslint-formatter-pretty

JSON →
library7.1.0jsnpmunverified

A pretty formatter for ESLint that provides aesthetically pleasing output with syntax highlighting, clickable hyperlinks for filenames and rule IDs, and severity-sorted results. Version 7.1.0 is the latest stable release, released in 2025, with a cadence of major breaking changes tied to Node.js version bumps. It ships TypeScript types and is maintained by Sindre Sorhus. Key differentiators: stylish output with inline codeblock styling, open-in-editor support for filenames, and rule doc links. Alternatives like `eslint-formatter-codeframe` focus on code frames without the visual polish.

npm install eslint-formatter-pretty
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-P
E
eslint-formatter-pretty
testingjavascriptv7.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
import eslintFormatterPretty from 'eslint-formatter-pretty';
const eslintFormatterPretty = require('eslint-formatter-pretty');
Since v6, the package is ESM-only. Use import syntax. CommonJS require will not work.
default (CommonJS)
import eslintFormatterPretty from 'eslint-formatter-pretty';
For projects still on ESLint v8, avoid v6+; use v5 with require('eslint-formatter-pretty') instead.

Shows how to use ESLint programmatically with the pretty formatter, including installation and CLI usage.

// Quick start: run ESLint with the pretty formatter // Install: npm install --save-dev eslint eslint-formatter-pretty // Then run: eslint --format=pretty src/ // Example to use programmatically: import eslint from 'eslint'; import eslintFormatterPretty from 'eslint-formatter-pretty'; async function lintAndFormat() { const engine = new eslint.ESLint(); const results = await engine.lintFiles(['src/']); const formatted = eslintFormatterPretty(results); console.log(formatted); } lintAndFormat().catch(console.error);
Debug
Known issues
breakingv6 requires Node.js 18 and ESLint v9+. ESLint v8 users must stick to v5.
fix
If using ESLint <9, install eslint-formatter-pretty@5 instead.
affects: >=6.0.0
breakingv7 drops Node.js 18 support; requires Node.js 20.
fix
Upgrade Node.js to 20 or use v6 which supports Node.js 18.
affects: >=7.0.0
deprecatedv5 is deprecated; it only receives critical security fixes.
fix
Upgrade to v6+ if using ESLint 9+, else stick with v5.
affects: >=5.0.0 <6.0.0
gotchaThe package is ESM-only from v6 onwards; require() will fail.
fix
Use dynamic import() or add 'type': 'module' to package.json.
affects: >=6.0.0
gotchaClickable hyperlinks for filenames and rule IDs only work in terminals with hyperlink support (e.g., iTerm2, VSCode terminal).
fix
Use a compatible terminal or rely on standard text output.
affects: *
Errors
Common errors & fixes
SyntaxError: Unexpected token 'export'
ESM-only package imported with require() in a CommonJS context.
fix
Use import() or set 'type': 'module' in package.json.
Error: Cannot find module 'eslint'
eslint is a peer dependency and must be installed separately.
fix
Run: npm install --save-dev eslint
TypeError: eslintFormatterPretty is not a function
Wrong import style (e.g., named import instead of default).
fix
Use: import eslintFormatterPretty from 'eslint-formatter-pretty';
Upgrade
Version history
7.1.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; this package formats ESLint results and must be used alongside ESLint.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-pretty — npm install eslint-formatter-pretty · libregistry