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 8f3dc55 commit 6d50fb6Copy full SHA for 6d50fb6
lib/rules/jsx-indent.js
@@ -159,12 +159,19 @@ module.exports = {
159
*/
160
function isNodeFirstInLine(node) {
161
let token = node;
162
+ let lines;
163
do {
164
token = sourceCode.getTokenBefore(token);
- } while (token.type === 'JSXText' && /^\s*$/.test(token.value));
165
+ lines = token.type === 'JSXText'
166
+ ? token.value.split('\n')
167
+ : null;
168
+ } while (
169
+ token.type === 'JSXText' &&
170
+ /^\s*$/.test(lines[lines.length - 1])
171
+ );
172
+
173
const startLine = node.loc.start.line;
174
const endLine = token ? token.loc.end.line : -1;
-
175
return startLine !== endLine;
176
}
177
0 commit comments