Skip to content

Commit 99d33e3

Browse files
committed
Deny unused variables and parameters in TypeScript/Vue
1 parent ddfd2b2 commit 99d33e3

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

site/frontend/src/graph/render.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ function wheelZoomPlugin(opts) {
210210
});
211211
}
212212

213-
function onup(e) {
213+
function onup(_e) {
214214
document.removeEventListener("mousemove", onmove);
215215
document.removeEventListener("mouseup", onup);
216216
}
@@ -294,7 +294,7 @@ function genPlotOpts({
294294
},
295295
scales: {
296296
y: {
297-
range: (self, dataMin, dataMax) =>
297+
range: (_self, dataMin, dataMax) =>
298298
uPlot.rangeNum(absoluteMode ? 0 : dataMin, dataMax, 0.2, true),
299299
},
300300
},
@@ -307,7 +307,7 @@ function genPlotOpts({
307307
{
308308
label: yAxisLabel,
309309
space: 24,
310-
values: (self, splits) => {
310+
values: (_self, splits) => {
311311
return splits.map((v) => {
312312
return v >= 1e12
313313
? v / 1e12 + "T"
@@ -328,7 +328,7 @@ function genPlotOpts({
328328
drawAxes: [
329329
(u) => {
330330
let {ctx} = u;
331-
let {left, top, width, height} = u.bbox;
331+
let {top, height} = u.bbox;
332332

333333
const interpolatedColorWithAlpha = "#fcb0f15f";
334334

@@ -355,7 +355,7 @@ function genPlotOpts({
355355
},
356356
},
357357
tooltipPlugin({
358-
onclick(u, seriesIdx, dataIdx) {
358+
onclick(_u, _seriesIdx, dataIdx) {
359359
let thisCommit = commits[dataIdx][1];
360360
let prevCommit = (commits[dataIdx - 1] || [null, null])[1];
361361
window.open(

site/frontend/src/pages/bootstrap/plots.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ function genPlotOpts({
140140
{
141141
label: yAxisLabel,
142142
space: 24,
143-
values: (self, splits) => {
143+
values: (_self, splits) => {
144144
return splits.map((v) => v / 1e9 + " sec");
145145
},
146146
},
147147
],
148148
plugins: [
149149
tooltipPlugin({
150-
onclick(u, seriesIdx, dataIdx) {
150+
onclick(_u, _seriesIdx, dataIdx) {
151151
let thisCommit = commits[dataIdx][1];
152152
let prevCommit = (commits[dataIdx - 1] || [null, null])[1];
153153
window.open(`/compare.html?start=${prevCommit}&end=${thisCommit}`);

site/frontend/src/pages/compare/compile/table/comparisons-table.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {CompileBenchmarkMap, CompileTestCase} from "../common";
77
import {computed} from "vue";
88
import {useExpandedStore} from "./expansion";
99
import BenchmarkDetail from "./benchmark-detail.vue";
10-
import {getPastDate} from "./utils";
1110
1211
const props = defineProps<{
1312
id: string;

site/frontend/src/pages/compare/metric-selector.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
createUrlWithAppendedParams,
44
navigateToUrlParams,
55
} from "../../utils/navigation";
6-
import {BenchmarkInfo} from "../../api";
76
import {MetricDescription} from "./metrics";
87
98
const props = defineProps<{

site/frontend/src/pages/compare/summary/count.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ const props = defineProps<{
77

88
<template>
99
<span :title="cases + ' test case(s), ' + benchmarks + ' unique benchmark(s)'"
10-
>{{ cases }} ({{ benchmarks }})</span
10+
>{{ props.cases }} ({{ props.benchmarks }})</span
1111
>
1212
</template>

site/frontend/src/pages/compare/tabs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="tsx">
2-
import {computed, h, ref, Ref} from "vue";
2+
import {h, ref, Ref} from "vue";
33
import {CompareResponse, Tab} from "./types";
44
import {
55
diffClass,

site/frontend/src/pages/status/page.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import {getJson} from "../../utils/requests";
33
import {STATUS_DATA_URL} from "../../urls";
44
import {withLoading} from "../../utils/loading";
5-
import {computed, ref, Ref, watch} from "vue";
5+
import {computed, ref, Ref} from "vue";
66
import {
77
Artifact,
88
BenchmarkError,
@@ -16,10 +16,8 @@ import {
1616
differenceInSeconds,
1717
format,
1818
fromUnixTime,
19-
sub,
2019
subSeconds,
2120
} from "date-fns";
22-
import {CompileTestCase} from "../compare/compile/common";
2321
import {useExpandedStore} from "./expansion";
2422
2523
async function loadStatus(loading: Ref<boolean>) {

site/frontend/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"rootDir": "src",
88
"esModuleInterop": true,
99
"jsx": "preserve",
10-
"jsxFactory": "h"
10+
"jsxFactory": "h",
11+
"noUnusedLocals": true,
12+
"noUnusedParameters": true
1113
}
1214
}

0 commit comments

Comments
 (0)