-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
I've got a function that accepts a function, that should return void
. But it can sometimes be async, so it would return Promise<void>
. The rule should accept a union of both.
So that the following is acceptable:
async function foo(bar: () => void | Promise<void>) {
await bar();
}
The other option would be to, of course, only accept Promise<void>
, but then I'd have to put async
on even funcs that don't use await
, 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.
tyankatsu0105 and Raynos
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin