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
F3363629: D10184.id34318.diff
Mon, Nov 25, 2:47 AM
F3363598: D10184.id34242.diff
Mon, Nov 25, 2:38 AM
F3363437: D10184.id34226.diff
Mon, Nov 25, 2:20 AM
F3363150: D10184.diff
Mon, Nov 25, 12:30 AM
Unknown Object (File)
Thu, Nov 7, 5:36 AM
Unknown Object (File)
Oct 16 2024, 2:35 AM
Unknown Object (File)
Oct 16 2024, 2:35 AM
Unknown Object (File)
Oct 16 2024, 2:35 AM
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
No Lint Coverage
Unit
No Test Coverage