[no-invalid-void-type] Should accept void | Promise<void>
#1956
Labels
enhancement
New feature or request
good first issue
Good for newcomers
has pr
there is a PR raised to close this
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
I've got a function that accepts a function, that should return
void
. But it can sometimes be async, so it would returnPromise<void>
. The rule should accept a union of both.So that the following is acceptable:
The other option would be to, of course, only accept
Promise<void>
, but then I'd have to putasync
on even funcs that don't useawait
, and then I'd get lint errors because of that. I think the solution proposed here is easier, and should still be in line with the spirit of the rule.The text was updated successfully, but these errors were encountered: