Hello devtools-dev,
Happy new year everyone! By taking advantage of the quieter times over the holidays, today we were able to add the no-floating-promises ESLint rule: https://crrev.com/c/3366468 Enabling this rule was one of the primary motivators for migrating to TypeScript and TypeScript-ESLint, and 2022 is finally the year we are able to make this change!
The rule will error on any function invocation of a function/method that returns a Promise, but is not await-ed or void-ed. There were over 1000 pre-existing errors, which have been suppressed by adding void expressions to all violations in https://crrev.com/c/3366467. We encourage everyone to take a quick look at code you are OWNER of in the suppression CL to get a sense of potential promise races in your implementations. For all new changes, you will be warned on presubmit (or live in your VS Code editor if you use the ESLint plugin) to avoid future regressions.
In almost all cases, you will want to await the function invocation result. In the unlikely event that the Promise race is intentional, you can append void in front of the invocation to suppress the error.
If you run into any issues, please let us know.
Cheers,
Tim