Registry / testing / eslint-junit

eslint-junit

JSON →
library1.0.1jsnpmunverified

An ESLint result processor that generates JUnit XML files for integration with CI systems like Jenkins. Current version 1.0.1, last released in 2017 with no recent updates (low maintenance). It works by running ESLint with a custom formatter and producing XML output configurable via environment variables or package.json. Similar to 'eslint-junit-formatter' but simpler and older. It has minimal dependencies and supports Node >=6.0.0.

npm install eslint-junit
INSTALL
IMPORT
SIG · ESLINT-JUNIT
E
eslint-junit
testingjavascriptv1.0.1
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 path from 'path'; // eslint-junit is used as a CLI formatter, not imported
const eslintJunit = require('eslint-junit');
This package is an ESLint formatter. It is not meant to be imported programmatically. Usage is via ESLint CLI with -f option.
CLI usage
eslint -f node_modules/eslint-junit/index.js
eslint --format junit
Use the path to the module directly, not 'junit' which is a built-in format.
Configuration via env vars
ESLINT_JUNIT_OUTPUT='./reports/junit.xml' eslint -f node_modules/eslint-junit/index.js
eslint -f eslint-junit --output ./reports/junit.xml
Configuration is done via environment variables or package.json, not CLI flags.

Installs eslint-junit as a dev dependency and runs ESLint with it, exporting JUnit XML to ./test-results/eslint-junit.xml.

npm install --save-dev eslint-junit # Run ESLint with eslint-junit formatter ESLINT_SUITE_NAME="My ESLint Tests" ESLINT_JUNIT_OUTPUT="./test-results/eslint-junit.xml" npx eslint -f ./node_modules/eslint-junit/index.js src/
Debug
Known issues
gotchaPackage is very old (2017). May not work with newer ESLint versions (>=7) due to formatter API changes.
fix
Switch to maintained alternatives like 'eslint-junit-formatter' or 'eslint-formatter-junit'.
affects: *
gotchaThe formatter does not support ESLint's --output-file flag; output must be configured via environment variable or package.json.
fix
Set ESLINT_JUNIT_OUTPUT environment variable or use package.json config.
affects: *
gotchaConfiguration via package.json requires a 'eslint-junit' key with string values. Boolean or numeric values may cause errors.
fix
Ensure all values in the config object are strings.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'eslint-junit'
ESLint is looking for formatter in unexpected location.
fix
Use full path: eslint -f ./node_modules/eslint-junit/index.js
Cannot read property 'replace' of undefined
Missing or malformed template variables in configuration.
fix
Ensure ESLINT_JUNIT_CLASSNAME or ESLINT_JUNIT_TITLE use valid placeholders like {ruleId}, {line}, {source}.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-junit — npm install eslint-junit · libregistry