From eb1b113332908e1948192ae3f0af0973452ffcc0 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Thu, 17 Oct 2024 02:41:13 +0800 Subject: [PATCH] Update rules/prefer-catch.js Co-authored-by: Sebastian Good <2230835+scagood@users.noreply.github.com> --- rules/prefer-catch.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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({