webhook/node_modules/eslint-plugin-github/lib/rules/no-then.js
Joel Male 1ada95e04a
v2.0.0 (#12)
- Convert project to Javascript/Typescript
- Allow custom headers to be passed in (optional)
- Allow body to be optional
2020-08-26 10:52:47 +10:00

17 lines
435 B
JavaScript

module.exports = {
meta: {
docs: {}
},
create(context) {
return {
MemberExpression(node) {
if (node.property && node.property.name === 'then') {
context.report(node.property, 'Prefer async/await to Promise.then()')
} else if (node.property && node.property.name === 'catch') {
context.report(node.property, 'Prefer async/await to Promise.catch()')
}
}
}
}
}