Skip to content

Commit 88ceebd

Browse files
committed
reporters: use Object.entries
1 parent e29273e commit 88ceebd

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

lib/reporters/checkstyle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ function checkstyle(results) {
3434

3535
out.push('<?xml version="1.0" encoding="utf-8"?><checkstyle>');
3636

37-
for (const file of Object.keys(files)) {
37+
for (const [file, errors] of Object.entries(files)) {
3838
out.push(`\t<file name="${file}">`);
3939

40-
for (const issue of files[file]) {
41-
out.push(`\t\t<error line="${issue.line}" column="${issue.column}" severity="${issue.severity}" message="${encode(issue.message)}" source="${issue.source}" />`);
40+
for (const error of errors) {
41+
out.push(`\t\t<error line="${error.line}" column="${error.column}" severity="${error.severity}" message="${encode(error.message)}" source="${error.source}" />`);
4242
}
4343

4444
out.push('\t</file>');

lib/reporters/junit.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ function junit(results) {
2929
});
3030
}
3131

32-
const filesArray = Object.keys(files);
32+
const filesArray = Object.entries(files);
3333

3434
out.push(`<?xml version="1.0" encoding="utf-8"?>\n<testsuite name="htmllint" tests="${filesArray.length}" failures="0" errors="${results.length}">`);
3535

36-
for (const file of filesArray) {
37-
const errors = files[file];
38-
36+
for (const [file, errors] of filesArray) {
3937
out.push(`<testcase name="${file}">\n<error message="${errors.length} Errors">`);
4038

4139
for (const [i, error] of errors.entries()) {

0 commit comments

Comments
 (0)