diff --git a/rules/prefer-catch.js b/rules/prefer-catch.js index 04af3848..4d002466 100644 --- a/rules/prefer-catch.js +++ b/rules/prefer-catch.js @@ -28,8 +28,7 @@ module.exports = { return { 'CallExpression > MemberExpression.callee'(node) { if ( - node.property && - node.property.name === 'then' && + node.property?.name === 'then' && node.parent.arguments.length >= 2 ) { context.report({