We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 358e933 commit 2428d4cCopy full SHA for 2428d4c
1 file changed
lib/rules/jsx-no-leaked-render.js
@@ -86,8 +86,8 @@ function ruleFixer(context, fixStrategy, fixer, reportedNode, leftNode, rightNod
86
const rightSideTextLines = rightSideText.split('\n');
87
if (rightSideTextLines.length > 1) {
88
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('');
+ const indentSpacesStart = ' '.repeat(rightSideTextLastLine.search(/\S/));
+ const indentSpacesClose = ' '.repeat(rightSideTextLastLine.search(/\S/) - 2);
91
return fixer.replaceText(reportedNode, `${newText} && (\n${indentSpacesStart}${rightSideText}\n${indentSpacesClose})`);
92
}
93
0 commit comments