mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
25 lines
568 B
JavaScript
25 lines
568 B
JavaScript
|
module.exports = {
|
||
|
meta: {
|
||
|
docs: {},
|
||
|
schema: []
|
||
|
},
|
||
|
|
||
|
create(context) {
|
||
|
const scopeDidWait = new WeakSet()
|
||
|
|
||
|
return {
|
||
|
AwaitExpression() {
|
||
|
scopeDidWait.add(context.getScope(), true)
|
||
|
},
|
||
|
MemberExpression(node) {
|
||
|
if (node.property && node.property.name === 'currentTarget') {
|
||
|
const scope = context.getScope()
|
||
|
if (scope.block.async && scopeDidWait.has(scope)) {
|
||
|
context.report(node, 'event.currentTarget inside an async function is error prone')
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|