Registry / testing / eslint-formatter-html

eslint-formatter-html

JSON →
library2.7.3jsnpmunverified

A enhanced ESLint formatter that outputs HTML reports with interactive features built on React and Ant Design. Version 2.7.3 is stable and actively maintained. It supports dark mode, ANSI code display, and file path/line copying. Unlike ESLint's built-in HTML formatter, it uses pako compression for small file sizes and relative file paths for brevity. The package is released irregularly but receives updates.

npm install eslint-formatter-html
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-H
E
eslint-formatter-html
testingjavascriptv2.7.3
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

default
✓ const htmlFormatter = require('eslint-formatter-html');
✗ import htmlFormatter from 'eslint-formatter-html';
This package is CommonJS only. ESM import will not work because it does not export an ES module.
default
✓ npx eslint -f html -o report.html
✗ npx eslint -f eslint-formatter-html -o report.html
The formatter name passed to -f is just 'html', not the full package name. ESLint resolves it from the package.
default
✓ const formatter = require('eslint-formatter-html'); const result = formatter(results);
The function expects an array of LintResult objects and returns an HTML string. Can be used programmatically with ESLint's API.

Shows how to use eslint-formatter-html programmatically to generate an HTML report from lint results.

// Install: npm i -D eslint-formatter-html // Generate HTML report: const { ESLint } = require('eslint'); const formatter = require('eslint-formatter-html'); async function main() { const eslint = new ESLint(); const results = await eslint.lintFiles(['src/**/*.js']); const html = formatter(results); // results is array of LintResult require('fs').writeFileSync('report.html', html); console.log('Report saved to report.html'); } main().catch(err => console.error(err));
Debug
Known issues
deprecatedThe 'format' export is deprecated; use default export instead.
fix
Use `require('eslint-formatter-html')` directly instead of `require('eslint-formatter-html').format`.
affects: <=2.0.0
gotchaThe formatter expects the LintResult array exactly as returned by ESLint. Modifying the structure may cause errors.
fix
Ensure you pass the raw results array from ESLint's API.
affects: >=1.0.0
gotchaThe output HTML file is self-contained but uses external CDN for React and Ant Design fonts (if not bundled).
fix
No built-in offline support; ensure network access or modify the formatter to inline dependencies.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-html'
Missing dependency or using wrong formatter name in ESLint config.
fix
Run `npm install --save-dev eslint-formatter-html` and use `-f html` (not the full package name).
TypeError: formatter is not a function
Using default import in ESM context or calling a nonexistent named export.
fix
Use `require('eslint-formatter-html')` (CommonJS) or treat the default export as the function.
Upgrade
Version history
2.7.3latest on npm
Audit
Dependencies
pakorequiredUsed for compressing the report data into the HTML file
reactrequiredRuntime dependency for the HTML report UI
antdrequiredUI component library used in the report
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-formatter-html — npm install eslint-formatter-html · libregistry