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 e60921c commit 2fb1d37Copy full SHA for 2fb1d37
lib/rules/jsx-indent.js
@@ -227,6 +227,11 @@ module.exports = {
227
// Use the parent in a list or an array
228
if (prevToken.type === 'JSXText' || prevToken.type === 'Punctuator' && prevToken.value === ',') {
229
prevToken = sourceCode.getNodeByRangeIndex(prevToken.start).parent;
230
+ // Use the first non-punctuator token in a conditional expression
231
+ } else if (prevToken.type === 'Punctuator' && prevToken.value === ':') {
232
+ do {
233
+ prevToken = sourceCode.getTokenBefore(prevToken);
234
+ } while (prevToken.type === 'Punctuator');
235
}
236
var parentElementIndent = getNodeIndent(prevToken);
237
var indent = (
0 commit comments