Skip to content

Commit 2428d4c

Browse files
committed
chore: use string repeat
1 parent 358e933 commit 2428d4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rules/jsx-no-leaked-render.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ function ruleFixer(context, fixStrategy, fixer, reportedNode, leftNode, rightNod
8686
const rightSideTextLines = rightSideText.split('\n');
8787
if (rightSideTextLines.length > 1) {
8888
const rightSideTextLastLine = rightSideTextLines[rightSideTextLines.length - 1];
89-
const indentSpacesStart = Array(rightSideTextLastLine.search(/\S/)).fill(' ').join('');
90-
const indentSpacesClose = Array(rightSideTextLastLine.search(/\S/) - 2).fill(' ').join('');
89+
const indentSpacesStart = ' '.repeat(rightSideTextLastLine.search(/\S/));
90+
const indentSpacesClose = ' '.repeat(rightSideTextLastLine.search(/\S/) - 2);
9191
return fixer.replaceText(reportedNode, `${newText} && (\n${indentSpacesStart}${rightSideText}\n${indentSpacesClose})`);
9292
}
9393
}

0 commit comments

Comments
 (0)