-
Notifications
You must be signed in to change notification settings - Fork 148
fix: consider promise.all() in await-async-utils #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: consider promise.all() in await-async-utils #236
Conversation
// verifies the CallExpression is Promise.all() | ||
function isPromiseAll(node: TSESTree.CallExpression) { | ||
return isMemberExpression(node.callee) && isIdentifier(node.callee.object) && node.callee.object.name === 'Promise' && isIdentifier(node.callee.property) && node.callee.property.name === 'all' | ||
} | ||
|
||
// verifies the node is part of an array used in a CallExpression | ||
function isInPromiseAll(node: TSESTree.Node) { | ||
const parent = node.parent | ||
return isCallExpression(parent) && isArrayExpression(parent.parent) && isCallExpression(parent.parent.parent) && isPromiseAll(parent.parent.parent) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if these are worth moving elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, they could be useful. We can move them when necessary tho.
I thought the 100% coverage was for the rules, not for the utils 🤔 🧐 should I create a Similar goes to Should we exclude files that are not under |
I thought so! I was planning to add specific tests for those in v4, so I'd wait for add specific tests for them. I guess we can modify the threshold meanwhile. |
8af7b73
to
aca5271
Compare
threshold updated for |
🎉 This PR is included in version 3.9.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #227
After a while, trying to program a Lil' bit outside of my regular work again. Here I'm just fixing the referenced ticket. I also added a bunch of helpers to
node-utils
instead of checking the node's type directly in the rule