From b086934b01feed53da4fa17ddd647c6150c66870 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Mon, 14 Jan 2019 21:07:09 -0800 Subject: [PATCH] refactor: move filename check up for improved efficiency in 'no-test-and-then' rule. --- lib/rules/no-test-and-then.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rules/no-test-and-then.js b/lib/rules/no-test-and-then.js index 7168df13c0..80bef63681 100644 --- a/lib/rules/no-test-and-then.js +++ b/lib/rules/no-test-and-then.js @@ -21,12 +21,12 @@ module.exports = { }, create(context) { + if (!emberUtils.isTestFile(context.getFilename())) { + return {}; + } + return { CallExpression(node) { - if (!emberUtils.isTestFile(context.getFilename())) { - return; - } - const callee = node.callee; if (utils.isIdentifier(callee) && callee.name === 'andThen') { context.report({