ESLint Detailed Reporter

raw JSON →
0.9.0 verified Sat Apr 25 auth: no javascript maintenance

An HTML reporter for ESLint that provides detailed output including total problem counts, tables of top warnings and errors, a list of files with the most issues, source code views with highlighted problems, and per-file summaries. Current version 0.9.0 supports ESLint 3.x to 8.x (peer dep: eslint >=3.0.0 <9). It features links to rule descriptions, keyboard accessibility, and optional multi-file output. Updated sporadically, last release in 2020.

error Cannot find module 'eslint-detailed-reporter'
cause The package was not installed or the require path is incorrect.
fix
Run npm install eslint-detailed-reporter --save-dev and ensure you are using require('eslint-detailed-reporter') (CommonJS) or import from 'eslint-detailed-reporter' (ESM).
error TypeError: reporter is not a function
cause Using default import incorrectly in ESM or supplying a string to format option in Grunt/ESLint config.
fix
For CommonJS: const reporter = require('eslint-detailed-reporter'); For ESM: import reporter from 'eslint-detailed-reporter'. In Grunt, use require('eslint-detailed-reporter') as the format value.
error Error: ESLint configuration is invalid: "format" must be a function or a full path to a formatter file.
cause Using a string for the format option in ESLint configuration object (e.g., in .eslintrc) is not supported; only CLI -f accepts string paths.
fix
In programmatic or config usage, pass the require'd function directly, not a string. For CLI, use -f node_modules/eslint-detailed-reporter/lib/detailed.js.
gotcha ESLint >=9 is not supported. The peer dependency specifies eslint >=3.0.0 <9, so ESLint 9 and above will not work.
fix Use an older version of ESLint (e.g., 8.x) or consider alternatives like eslint-formatter-html.
gotcha The multi-file output feature is marked as BETA and may have bugs.
fix Stick with single-file mode for stability. If using multi-file, test thoroughly.
gotcha When using Grunt, you must pass the reporter function via require, not a string.
fix Use format: require('eslint-detailed-reporter') instead of format: 'eslint-detailed-reporter'.
gotcha With Gulp, you need to call eslint.format with a callback to write the HTML output; just passing the reporter won't generate a file.
fix Use eslint.format(reporter, function(results) { fs.writeFileSync(...) });
npm install eslint-detailed-reporter
yarn add eslint-detailed-reporter
pnpm add eslint-detailed-reporter

Shows installation, CLI usage for single and multi-file output, and programmatic usage with Node.js.

// Install
npm install eslint-detailed-reporter --save-dev

// Run ESLint with the reporter (single file output)
eslint file.js -f node_modules/eslint-detailed-reporter/lib/detailed.js -o report.html

// Run ESLint with the reporter (multi-file output, experimental)
eslint . -f node_modules/eslint-detailed-reporter/lib/detailed-multi.js -o report.html

// Alternative: use the exported module for programmatic usage
const reporter = require('eslint-detailed-reporter');
const fs = require('fs');
const results = /* get ESLint results */;
const html = reporter(results);
fs.writeFileSync('report.html', html);