Handvask / handvask

Local variable name shadows variable in outer scope JS-0123
Bug risk
Minor
a year agoa year old
'r' is already declared in the upper scope on line 80 column 62.
 95          );
 96          return tmp;
 97        });
 98        get<Run[]>(`runs?${listToUrlEncoded([run.id], "run_ids")}`, (r) => { 99          setData((v) => {
100            if (!v) return v;
101            const tmp = [...v];
'r' is already declared in the upper scope on line 80 column 62.
 83        setData((v) => {
 84          if (!v) return v;
 85          const tmp = [...v];
 86          tmp[tmp.findIndex((r) => r.id === run.id)].solvers = tmp[ 87            tmp.findIndex((r) => r.id === run.id)
 88          ].solvers.filter(
 89            (solver) =>
'r' is already declared in the upper scope on line 80 column 62.
 84          if (!v) return v;
 85          const tmp = [...v];
 86          tmp[tmp.findIndex((r) => r.id === run.id)].solvers = tmp[
 87            tmp.findIndex((r) => r.id === run.id) 88          ].solvers.filter(
 89            (solver) =>
 90              !(
'user' is already declared in the upper scope on line 21 column 9.
 33    });
 34  }
 35
 36  function handleUserCPUChange(user: CustomUserT, new_max: number) { 37    if (data) {
 38      setUsers((v) => {
 39        if (!v) {
'user' is already declared in the upper scope on line 21 column 9.
 48  }
 49
 50  function updateUserMaxCPU(
 51    user: CustomUserT, 52    event: ChangeEvent<HTMLInputElement>
 53  ) {
 54    const new_max = Number(event.target.value);