HomePhabricator
Diffusion Comm e999c3146bd5

Add unused-promise Lint to all Flow configs except desktop

Description

Add unused-promise Lint to all Flow configs except desktop

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

Reviewers: michal

Reviewed By: michal

Subscribers: tomek, michal

Differential Revision: https://phab.comm.dev/D10184

Details

Provenance
ashoatAuthored on Dec 4 2023, 1:01 PM
Reviewer
michal
Differential Revision
D10184: Add unused-promise Lint to all Flow configs except desktop
Parents
rCOMM3f70a493979b: [keyserver] Ignore promise rejections from websocket message handler
Branches
Unknown
Tags
Unknown