Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUsing async executor of promise should be a problem #1239
Comments
This comment has been minimized.
This comment has been minimized.
DiegoRBaquero
commented
Jan 21, 2019
|
I agree, this should be a rule. Related https://eslint.org/docs/rules/no-async-promise-executor |
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Apr 21, 2019
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
Apr 21, 2019
stale
bot
closed this
Apr 28, 2019
This comment has been minimized.
This comment has been minimized.
lropero
commented
Jul 11, 2019
|
I don't understand this rule, why can't I have an async executor with the corresponding try/catch blocks surrounding the async operation in order to reject the promise if it fails? I believe the rule should be something like if-async-promise-executor-then-try-catch-surrounding-await. Only thing this rule accomplishes is force me to nest .then() constructs which spaghettifies my code. |
This comment has been minimized.
This comment has been minimized.
|
@gliluaume @DiegoRBaquero This rule was included in standard 13. @lropero Please open a new issue to ask a question instead of posting in an already closed issue. |
This comment has been minimized.
This comment has been minimized.
lropero
commented
Jul 13, 2019
|
Thanks @feross, I opened this request change at ESLint's GitHub discussing the issue. |
gliluaume commentedJan 8, 2019
What version of standard?
12.0.1
What operating system, Node.js, and npm version?
What did you expect to happen?
Have a warning saying that async function should not be used as a Promise executor in the following code:
What actually happened?
No problem is shown.