A reporter for eslint which produces a report compatible with Atlassian Bamboo Mocha Test Parser.
Bamboo's Mocha Test Parser reads test results from a Mocha-style JSON file. This formatter writes ESLint results in that format, with one entry per linted file, so lint failures show up as test results in your Bamboo build report.
npm install --save-dev eslint-bamboo-formatterRequires Node.js 20.19 or newer.
Run ESLint with the formatter from the CLI:
eslint file.js -f node_modules/eslint-bamboo-formatter/reporter.jsThe formatter only reads ESLint's results, so it works the same whether your project uses the flat config (eslint.config.js) or the legacy .eslintrc.
Two environment variables control the output:
ESLINT_FILE: path of the JSON file to write (defaulteslint.json).ESLINT_WARNING_AS_ERROR: when set, warnings are counted as failures. Warnings are ignored by default.
Linting one file with an error and one clean file produces:
{
"stats": {
"tests": 2,
"passes": 1,
"failures": 1,
"duration": 0,
"start": "2026-06-25T12:00:00.000Z",
"end": "2026-06-25T12:00:00.000Z"
},
"failures": [
{
"title": "bad.js",
"fullTitle": "/src/bad.js",
"duration": 0,
"errorCount": 1,
"error": "1 Failure: 1. line 2, column 5: Unexpected var, use let or const instead."
}
],
"passes": [
{
"title": "good.js",
"fullTitle": "/src/good.js",
"duration": 0,
"errorCount": 0
}
],
"skipped": []
}The formatter is written in TypeScript under src/ and built with tsup to dual ESM/CJS with type declarations. The published reporter.js is a thin CommonJS entry that re-exports the build.
npm install
npm run build # bundle to dist/ (ESM + CJS + .d.ts)
npm test # run the vitest suite
npm run lint # eslint flat config
npm run typecheck # tsc --noEmit
npm run format # prettier --writeThe Bamboo report format is pinned by snapshot tests, which generate realistic results through ESLint's Node API. Keep them green when touching the output.