You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on my practice, the indent rule can "almost" replace the jsx-indent rule and do a better job. Before I made the fix (#368), there was even a conflict between the two. Moreover, jsx-indent would lack indentation in multiline ternary operations. So now I prefer to turn off the jsx-indent rule and use only the indent rule. However, the reason I used the word "almost" is because indent does not handle the following situation:
<div>
JSXText // `indent` does not indent for this
{'Literal in JSXExpressionContainer'} // `indent` will indent for this node
</div>
Suggested solution
Support JSXText indentation for the indent rule. Considering that the rule already indents almost all JSX-related nodes (and it handles the overlapping parts of JSX nodes with other nodes quite well), the current lack of support for JSXText might be considered a BUG? I believe this should not be considered a breaking change.
Clear and concise description of the problem
Based on my practice, the
indent
rule can "almost" replace thejsx-indent
rule and do a better job. Before I made the fix (#368), there was even a conflict between the two. Moreover,jsx-indent
would lack indentation in multiline ternary operations. So now I prefer to turn off thejsx-indent
rule and use only theindent
rule. However, the reason I used the word "almost" is becauseindent
does not handle the following situation:Suggested solution
Support JSXText indentation for the
indent
rule. Considering that the rule already indents almost all JSX-related nodes (and it handles the overlapping parts of JSX nodes with other nodes quite well), the current lack of support for JSXText might be considered a BUG? I believe this should not be considered a breaking change.Alternative
No response
Additional context
No response
Validations
Contributes
The text was updated successfully, but these errors were encountered: