{"id":19674,"library":"eslint-junit","title":"eslint-junit","description":"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.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/jcgertig/eslint-junit","tags":["javascript"],"install":[{"cmd":"npm install eslint-junit","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-junit","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-junit","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is an ESLint formatter. It is not meant to be imported programmatically. Usage is via ESLint CLI with -f option.","wrong":"const eslintJunit = require('eslint-junit');","symbol":"default","correct":"import path from 'path'; // eslint-junit is used as a CLI formatter, not imported"},{"note":"Use the path to the module directly, not 'junit' which is a built-in format.","wrong":"eslint --format junit","symbol":"CLI usage","correct":"eslint -f node_modules/eslint-junit/index.js"},{"note":"Configuration is done via environment variables or package.json, not CLI flags.","wrong":"eslint -f eslint-junit --output ./reports/junit.xml","symbol":"Configuration via env vars","correct":"ESLINT_JUNIT_OUTPUT='./reports/junit.xml' eslint -f node_modules/eslint-junit/index.js"}],"quickstart":{"code":"npm install --save-dev eslint-junit\n# Run ESLint with eslint-junit formatter\nESLINT_SUITE_NAME=\"My ESLint Tests\" ESLINT_JUNIT_OUTPUT=\"./test-results/eslint-junit.xml\" npx eslint -f ./node_modules/eslint-junit/index.js src/","lang":"javascript","description":"Installs eslint-junit as a dev dependency and runs ESLint with it, exporting JUnit XML to ./test-results/eslint-junit.xml."},"warnings":[{"fix":"Switch to maintained alternatives like 'eslint-junit-formatter' or 'eslint-formatter-junit'.","message":"Package is very old (2017). May not work with newer ESLint versions (>=7) due to formatter API changes.","severity":"gotcha","affected_versions":"*"},{"fix":"Set ESLINT_JUNIT_OUTPUT environment variable or use package.json config.","message":"The formatter does not support ESLint's --output-file flag; output must be configured via environment variable or package.json.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure all values in the config object are strings.","message":"Configuration via package.json requires a 'eslint-junit' key with string values. Boolean or numeric values may cause errors.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use full path: eslint -f ./node_modules/eslint-junit/index.js","cause":"ESLint is looking for formatter in unexpected location.","error":"Error: Cannot find module 'eslint-junit'"},{"fix":"Ensure ESLINT_JUNIT_CLASSNAME or ESLINT_JUNIT_TITLE use valid placeholders like {ruleId}, {line}, {source}.","cause":"Missing or malformed template variables in configuration.","error":"Cannot read property 'replace' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}