Skip to content

Commit 2069e08

Browse files
committed
lint
1 parent 8715232 commit 2069e08

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

src/js/histogram.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ function drawClientSummary(data, options, client) {
4040
}
4141

4242
function getSummary(data, options) {
43-
const summary = getPrimaryMetric(data, options);
43+
const summary = getPrimaryMetric(data);
4444
const metric = new Metric(options, summary);
4545

4646
return metric.toString();
4747
}
4848

49-
function getPrimaryMetric(data, options) {
49+
function getPrimaryMetric(data) {
5050
data = data.filter(o => +o.cdf > 0.5);
5151
if (!data.length) {
5252
return '?';

src/js/report.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ class Report {
3434
}
3535

3636
bindChangeListener(id) {
37-
document.getElementById(id).addEventListener('change', e => {
37+
document.getElementById(id).addEventListener('change', (e) => {
3838
this[id] = e.target.value
3939
this.updatePermalink();
4040
});
4141
}
4242

4343
bindUpdateListener() {
44-
document.getElementById('update').addEventListener('click', _ => {
44+
document.getElementById('update').addEventListener('click', () => {
4545
// TODO: Consider using history.replaceState on field changes instead.
4646
location.href = this.permalink.value;
4747
});
4848
}
4949

5050
bindTableVisibilityToggle() {
51-
document.body.addEventListener('click', e => {
51+
document.body.addEventListener('click', (e) => {
5252
if (!e.target.classList.contains('show-hide')) {
5353
return;
5454
}
@@ -182,7 +182,7 @@ class Report {
182182
const gridExpanderSelector = '.grid-expansion, .metric-header a';
183183
Array.from(document.querySelectorAll(gridExpanderSelector)).forEach(btn => {
184184
const metricId = btn.dataset.metric;
185-
btn.addEventListener('click', e => {
185+
btn.addEventListener('click', () => {
186186
this.toggleMetricExpansion(metricId);
187187
});
188188
});
@@ -210,7 +210,7 @@ class Report {
210210

211211
getWPT(wptId) {
212212
const wpt = new WPT(wptId);
213-
wpt.fetchResults().then(results => {
213+
wpt.fetchResults().then(() => {
214214
const metrics = wpt.getMetrics(this.report);
215215
Object.entries(metrics).forEach(([metric, value]) => {
216216
const options = this.report.metrics.find(m => m.id === metric);

src/js/send-web-vitals.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function sendWebVitals() {
8282
debug_target: attribution.loadState || '(not set)',
8383
};
8484
break;
85-
case 'INP':
85+
case 'INP': {
8686
const loafAttribution = getLoafAttribution(attribution);
8787
overrides = {
8888
debug_event: attribution.interactionType,
@@ -95,6 +95,7 @@ function sendWebVitals() {
9595
...loafAttribution
9696
};
9797
break;
98+
}
9899
case 'LCP':
99100
overrides = {
100101
debug_url: attribution.url,

src/js/techreport/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ class TechReport {
8989
this.getAllMetricData();
9090
break;
9191

92-
case 'category':
92+
case 'category': {
9393
const category = this.filters.category || 'CMS';
9494
this.initializeReport();
9595
this.getCategoryData(category);
9696
break;
97+
}
9798
}
9899
}
99100

src/js/techreport/table.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function sortTableBy(dataset, key) {
7575
}
7676

7777
function getColumnCell(columnConfig, data, date) {
78-
const { config, column, client, app, subcategory, metric, endpoint } = columnConfig;
78+
const { column, client, app, subcategory, endpoint } = columnConfig;
7979

8080
const _data = data[app]?.find(entry => entry.date === date);
8181
const endpointData = _data?.[endpoint];

src/js/timeseries.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function drawTimeseries(data, options) {
143143
.then(flagSeries => series.push(flagSeries))
144144
// If the getFlagSeries request fails (503), catch so we can still draw the chart
145145
.catch(console.error)
146-
.then(_ => {
146+
.then( () => {
147147
const chart = document.getElementById(options.chartId);
148148
callOnceWhenVisible(chart, () => drawChart(options, series));
149149
});
@@ -177,7 +177,7 @@ function drawTimeseriesTable(data, options, [start, end]=[-Infinity, Infinity])
177177
if (!options.timeseries || !options.timeseries.fields) {
178178
const trMeta = el('tr');
179179
trMeta.classList.add('meta-row');
180-
DEFAULT_COLS.map(col => {
180+
DEFAULT_COLS.map(() => {
181181
return el('td');
182182
}).forEach(td => trMeta.appendChild(td));
183183
const th = el('th');
@@ -212,7 +212,7 @@ function drawTimeseriesTable(data, options, [start, end]=[-Infinity, Infinity])
212212

213213
const isDesktop = o => o.client == 'desktop';
214214
const isMobile = o => o.client == 'mobile';
215-
const toNumeric = ({client, date, ...other}) => {
215+
const toNumeric = ({client, ...other}) => {
216216
return Object.entries(other).reduce((o, [k, v]) => {
217217
o[k] = +v;
218218
return o;
@@ -452,7 +452,7 @@ const zip = data => {
452452
let row = dates[o.timestamp];
453453
if (row) {
454454
row.push(o);
455-
row.sort((a, b) => a.client == 'desktop' ? -1 : 1)
455+
row.sort((a) => a.client == 'desktop' ? -1 : 1)
456456
return;
457457
}
458458
dates[o.timestamp] = [o];

0 commit comments

Comments
 (0)