diff --git a/lib/reporters/checkstyle.js b/lib/reporters/checkstyle.js index 60258a2..efe66a3 100644 --- a/lib/reporters/checkstyle.js +++ b/lib/reporters/checkstyle.js @@ -34,11 +34,11 @@ function checkstyle(results) { out.push(''); - for (const file of Object.keys(files)) { + for (const [file, errors] of Object.entries(files)) { out.push(`\t`); - for (const issue of files[file]) { - out.push(`\t\t`); + for (const error of errors) { + out.push(`\t\t`); } out.push('\t'); diff --git a/lib/reporters/junit.js b/lib/reporters/junit.js index a97a46a..ed42981 100644 --- a/lib/reporters/junit.js +++ b/lib/reporters/junit.js @@ -29,13 +29,11 @@ function junit(results) { }); } - const filesArray = Object.keys(files); + const filesArray = Object.entries(files); out.push(`\n`); - for (const file of filesArray) { - const errors = files[file]; - + for (const [file, errors] of filesArray) { out.push(`\n`); for (const [i, error] of errors.entries()) {