Skip to content

Commit 773d4d0

Browse files
author
Bastien Abadie
committed
frontend: Manual eslint fixes
1 parent 05bb303 commit 773d4d0

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
@@ -39,6 +39,7 @@ function cacheGet(cache, key) {
3939
if (key in cache) {
4040
return cache[key].val;
4141
}
42+
return null;
4243
}
4344

4445
function cacheSet(cache, key, value) {
@@ -202,7 +203,7 @@ export async function getSource(file) {
202203
const response = await fetch(
203204
`https://hg.mozilla.org/mozilla-central/raw-file/tip/${file}`
204205
);
205-
return await response.text();
206+
return response.text();
206207
}
207208

208209
// Filtering.
@@ -370,7 +371,7 @@ export function hide(id) {
370371

371372
export function show(id, node) {
372373
if (!canDisplay()) {
373-
return;
374+
return null;
374375
}
375376

376377
const box = document.getElementById(id);
@@ -382,12 +383,16 @@ export function show(id, node) {
382383
}
383384

384385
export function render(template, data, target) {
385-
var output = Mustache.render(
386+
const output = Mustache.render(
386387
document.getElementById(template).innerHTML,
387388
data
388389
);
389390
const box = document.getElementById(target);
391+
392+
// The innerHTML check is disabled because we trust Mustache output
393+
// eslint-disable-next-line no-unsanitized/property
390394
box.innerHTML = output;
395+
391396
box.style.display = "block";
392397
return box;
393398
}

frontend/src/zero_coverage_report.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,6 @@ function cumStats(prevStats, newStats) {
104104
);
105105
}
106106

107-
function getFileSize(size) {
108-
if (size >= 1e6) {
109-
return (size / 1e6).toFixed(2) + "M";
110-
} else if (size >= 1e3) {
111-
return (size / 1e3).toFixed(1) + "K";
112-
}
113-
return size;
114-
}
115-
116107
export async function zeroCoverageDisplay(data, dir) {
117108
hide("output");
118109
hide("history");

0 commit comments

Comments
 (0)