114 });
115 }
116
117 function deleteRun(run: Run, solver_ids: number[] | null = null) {118 setDeletingRun(true);
119 post(`/runs/delete/${run.id}`, "", (r) => {
120 if (r.success) {
1import { useState } from "react"; 2import useAPI from "../../hooks/useAPI";
3import AsyncBtn from "../AsyncBtn";
4import Button from "../Button";
1import { useState } from "react";
2import useAPI from "../../hooks/useAPI"; 3import AsyncBtn from "../AsyncBtn";
4import Button from "../Button";
5import Modal from "../Modal";
1import { useState } from "react";
2import useAPI from "../../hooks/useAPI";
3import AsyncBtn from "../AsyncBtn"; 4import Button from "../Button";
5import Modal from "../Modal";
6import React from "react";
10 faSpinner,
11 faTrash,
12} from "@fortawesome/free-solid-svg-icons";
13import Button from "../components/Button"; 14import PageLoader from "../components/PageLoader";
15import { SuccessResponse } from "../functions";
16
Unused variables are generally considered a code smell and should be avoided.
Removing unused references - It prevents unused modules from being loaded at runtime, improving performance, and preventing the compiler from loading metadata that will never be used. - It prevents conflicts that may occur when trying to reference another variable.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
import fs from 'fs' // <- unused
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)