From 80f7b525329f8c8d9879cd61b618a592ba4a9f85 Mon Sep 17 00:00:00 2001 From: caroline223 <67647836+caroline223@users.noreply.github.com> Date: Wed, 6 Jul 2022 00:36:27 -0400 Subject: [PATCH] Made requested changes --- lib/rules/jsx-indent.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/rules/jsx-indent.js b/lib/rules/jsx-indent.js index c6f362c58e..6946e35f6b 100644 --- a/lib/rules/jsx-indent.js +++ b/lib/rules/jsx-indent.js @@ -168,18 +168,15 @@ module.exports = { * @return {Number} Indent */ function getNodeIndent(node, byLastLine, excludeCommas) { - const finalLine = !!byLastLine; - const noCommas = !!excludeCommas; - let src = context.getSourceCode().getText(node, node.loc.start.column + extraColumnStart); const lines = src.split('\n'); - if (finalLine) { + if (byLastLine) { src = lines[lines.length - 1]; } else { src = lines[0]; } - const skip = noCommas ? ',' : ''; + const skip = excludeCommas ? ',' : ''; let regExp; if (indentType === 'space') {