palladians / pallad

Either all code paths should have explicit returns, or none of them JS-0045
Anti-pattern
Minor
a month ago2 months old
Async arrow function expected no return value
51      const authenticated = (await securePersistence.getItem("foo")) === "bar"
52      if (!authenticated) {
53        await sessionPersistence.removeItem("spendingPassword")
54        return unlockWalletForm.setError("spendingPassword", {55          type: "wrongPassword",56          message: "The spending password is wrong",57        })58      }
59      navigate("/dashboard")
60    })
Expected to return a value at the end of arrow function
51              })
52            }, 1000)
53            chrome.runtime.onMessage.addListener(listener)
54            const closeListener = (closedWindowId: number) => {55              chrome.windows.onRemoved.removeListener(closeListener)
56              if (closedWindowId === newWindow?.id) {
57                return reject(new Error("4001 - User Rejected Request"))
Expected to return a value at the end of async arrow function
19        height: 772,
20        state: "normal",
21      })
22      .then(async (newWindow) => {23        const listener = (response: any) => {
24          if (response.windowId === newWindow?.id) {
25            chrome.runtime.onMessage.removeListener(listener)
Expected to return a value at the end of arrow function
 2
 3function runCommand(command: string): Promise<void> {
 4  return new Promise((resolve, reject) => {
 5    exec(command, (error, stdout, stderr) => { 6      if (error) {
 7        console.error(`Error: ${error.message}`)
 8        return reject(error)
Async arrow function expected no return value
62      )
63      mixpanel.track("WalletRestored")
64      await setVaultStateInitialized()
65      return navigate("/onboarding/finish")66    } finally {
67      setRestoring(false)
68    }