Page MenuHomePhabricator

Add unused-promise Lint to all Flow configs except desktop
ClosedPublic

Authored by ashoat on Dec 4 2023, 1:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 3, 8:03 PM
Unknown Object (File)
Sun, Sep 29, 3:35 PM
Unknown Object (File)
Fri, Sep 27, 12:23 PM
Unknown Object (File)
Sep 4 2024, 6:20 PM
Unknown Object (File)
Sep 4 2024, 6:20 PM
Unknown Object (File)
Sep 4 2024, 6:20 PM
Unknown Object (File)
Sep 4 2024, 6:20 PM
Unknown Object (File)
Sep 4 2024, 6:20 PM
Subscribers

Details

Summary

This diff finishes the stack by add unused-promise=error to most .flowconfigs.

We really only need it for keyserver, but adding it for keyserver results in error flagging on lib, web, and landing... so I figured I'd just apply it everywhere. Full context on that decision here.

As for desktop, it's not clear to me how to proceed. In this case, for runtimes that don't care about promise rejections, I mostly ignored the errors by prefixing the invocation with void. But for keyserver, where the promise rejections do matter, I handled each case more carefully.

I asked @michal a question here about whether Electron runtimes like desktop share the Node.js behavior of crashing on unhandled exceptions. I think Electron is built on top of Node.js, but it's a unique scenario, so I'm not sure.

Once I get an answer there, I'll decide on how to proceed for desktop, and submit some follow-up diffs to enable unused-promise for it as well.

Depends on D10183

Test Plan

Flow

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable