Skip to content

Commit

Permalink
Merge pull request #1764 from rust-lang/deny-unused-ts
Browse files Browse the repository at this point in the history
Deny unused variables and parameters in TypeScript/Vue
  • Loading branch information
Kobzol authored Dec 7, 2023
2 parents ddfd2b2 + 99d33e3 commit 21fabf4
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
10 changes: 5 additions & 5 deletions site/frontend/src/graph/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function wheelZoomPlugin(opts) {
});
}

function onup(e) {
function onup(_e) {
document.removeEventListener("mousemove", onmove);
document.removeEventListener("mouseup", onup);
}
Expand Down Expand Up @@ -294,7 +294,7 @@ function genPlotOpts({
},
scales: {
y: {
range: (self, dataMin, dataMax) =>
range: (_self, dataMin, dataMax) =>
uPlot.rangeNum(absoluteMode ? 0 : dataMin, dataMax, 0.2, true),
},
},
Expand All @@ -307,7 +307,7 @@ function genPlotOpts({
{
label: yAxisLabel,
space: 24,
values: (self, splits) => {
values: (_self, splits) => {
return splits.map((v) => {
return v >= 1e12
? v / 1e12 + "T"
Expand All @@ -328,7 +328,7 @@ function genPlotOpts({
drawAxes: [
(u) => {
let {ctx} = u;
let {left, top, width, height} = u.bbox;
let {top, height} = u.bbox;

const interpolatedColorWithAlpha = "#fcb0f15f";

Expand All @@ -355,7 +355,7 @@ function genPlotOpts({
},
},
tooltipPlugin({
onclick(u, seriesIdx, dataIdx) {
onclick(_u, _seriesIdx, dataIdx) {
let thisCommit = commits[dataIdx][1];
let prevCommit = (commits[dataIdx - 1] || [null, null])[1];
window.open(
Expand Down
4 changes: 2 additions & 2 deletions site/frontend/src/pages/bootstrap/plots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ function genPlotOpts({
{
label: yAxisLabel,
space: 24,
values: (self, splits) => {
values: (_self, splits) => {
return splits.map((v) => v / 1e9 + " sec");
},
},
],
plugins: [
tooltipPlugin({
onclick(u, seriesIdx, dataIdx) {
onclick(_u, _seriesIdx, dataIdx) {
let thisCommit = commits[dataIdx][1];
let prevCommit = (commits[dataIdx - 1] || [null, null])[1];
window.open(`/compare.html?start=${prevCommit}&end=${thisCommit}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {CompileBenchmarkMap, CompileTestCase} from "../common";
import {computed} from "vue";
import {useExpandedStore} from "./expansion";
import BenchmarkDetail from "./benchmark-detail.vue";
import {getPastDate} from "./utils";
const props = defineProps<{
id: string;
Expand Down
1 change: 0 additions & 1 deletion site/frontend/src/pages/compare/metric-selector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
createUrlWithAppendedParams,
navigateToUrlParams,
} from "../../utils/navigation";
import {BenchmarkInfo} from "../../api";
import {MetricDescription} from "./metrics";
const props = defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion site/frontend/src/pages/compare/summary/count.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ const props = defineProps<{

<template>
<span :title="cases + ' test case(s), ' + benchmarks + ' unique benchmark(s)'"
>{{ cases }} ({{ benchmarks }})</span
>{{ props.cases }} ({{ props.benchmarks }})</span
>
</template>
2 changes: 1 addition & 1 deletion site/frontend/src/pages/compare/tabs.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="tsx">
import {computed, h, ref, Ref} from "vue";
import {h, ref, Ref} from "vue";
import {CompareResponse, Tab} from "./types";
import {
diffClass,
Expand Down
4 changes: 1 addition & 3 deletions site/frontend/src/pages/status/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {getJson} from "../../utils/requests";
import {STATUS_DATA_URL} from "../../urls";
import {withLoading} from "../../utils/loading";
import {computed, ref, Ref, watch} from "vue";
import {computed, ref, Ref} from "vue";
import {
Artifact,
BenchmarkError,
Expand All @@ -16,10 +16,8 @@ import {
differenceInSeconds,
format,
fromUnixTime,
sub,
subSeconds,
} from "date-fns";
import {CompileTestCase} from "../compare/compile/common";
import {useExpandedStore} from "./expansion";
async function loadStatus(loading: Ref<boolean>) {
Expand Down
4 changes: 3 additions & 1 deletion site/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"rootDir": "src",
"esModuleInterop": true,
"jsx": "preserve",
"jsxFactory": "h"
"jsxFactory": "h",
"noUnusedLocals": true,
"noUnusedParameters": true
}
}

0 comments on commit 21fabf4

Please sign in to comment.