Skip to content

Commit d897995

Browse files
author
Bastien Abadie
committed
frontend: Manual eslint fixes
1 parent 59cbe3c commit d897995

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

frontend/src/common.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function cacheGet(cache, key) {
4040
if (key in cache) {
4141
return cache[key].val;
4242
}
43+
return null;
4344
}
4445

4546
function cacheSet(cache, key, value) {
@@ -209,7 +210,7 @@ export async function getSource(file) {
209210
const response = await fetch(
210211
`https://hg.mozilla.org/mozilla-central/raw-file/tip/${file}`
211212
);
212-
return await response.text();
213+
return response.text();
213214
}
214215

215216
// Filtering.
@@ -377,7 +378,7 @@ export function hide(id) {
377378

378379
export function show(id, node) {
379380
if (!canDisplay()) {
380-
return;
381+
return null;
381382
}
382383

383384
const box = document.getElementById(id);
@@ -389,12 +390,16 @@ export function show(id, node) {
389390
}
390391

391392
export function render(template, data, target) {
392-
var output = Mustache.render(
393+
const output = Mustache.render(
393394
document.getElementById(template).innerHTML,
394395
data
395396
);
396397
const box = document.getElementById(target);
398+
399+
// The innerHTML check is disabled because we trust Mustache output
400+
// eslint-disable-next-line no-unsanitized/property
397401
box.innerHTML = output;
402+
398403
box.style.display = "block";
399404
return box;
400405
}

frontend/src/zero_coverage_report.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,6 @@ function cumStats(prevStats, newStats) {
125125
);
126126
}
127127

128-
function getFileSize(size) {
129-
if (size >= 1e6) {
130-
return (size / 1e6).toFixed(2) + "M";
131-
} else if (size >= 1e3) {
132-
return (size / 1e3).toFixed(1) + "K";
133-
}
134-
return size;
135-
}
136-
137128
export async function zeroCoverageDisplay(data, dir) {
138129
hide("output");
139130
hide("history");

0 commit comments

Comments
 (0)