What version of this package are you using?
15.0.0
What operating system, Node.js, and npm version?
Fedora 32, Node 12, Yarn 1
What happened?
The offsetTernaryExpressions option for indent rule tries to "fix" JSX code that includes ternaries, but then jsx/indent (via standard-react) gets upset that the indentation isn't what it wants. multiline-ternary may also be contributing to this issue.
Here's some example failing code. Attempting to "autofix" will just trigger the other rule, and so on. I tried manually find a structure that it's happy with but nothing seems to satisfy it.
const Test = ({ children }) => {
const t = true
return (
<div>
{t ? (
<div>
true
</div>
) : (
<div>
false
</div>
)}
</div>
)
}
What did you expect to happen?
Both standard and standard-react are happy to work together.
Are you willing to submit a pull request to fix this bug?
Depends on the agreed solution. I don't know if this is an issue with indent and/or jsx/indent. Disabling offsetTernaryExpressions and multiline-ternary "fixes" the conflict in the mean time.
Personally, I'm happy to stick with 14.x as the ternary rules can't autofix everything and there's a lot of fixes I'll need to make on my end.
What version of this package are you using?
15.0.0
What operating system, Node.js, and npm version?
Fedora 32, Node 12, Yarn 1
What happened?
The
offsetTernaryExpressionsoption forindentrule tries to "fix" JSX code that includes ternaries, but thenjsx/indent(via standard-react) gets upset that the indentation isn't what it wants.multiline-ternarymay also be contributing to this issue.Here's some example failing code. Attempting to "autofix" will just trigger the other rule, and so on. I tried manually find a structure that it's happy with but nothing seems to satisfy it.
What did you expect to happen?
Both
standardandstandard-reactare happy to work together.Are you willing to submit a pull request to fix this bug?
Depends on the agreed solution. I don't know if this is an issue with
indentand/orjsx/indent. DisablingoffsetTernaryExpressionsandmultiline-ternary"fixes" the conflict in the mean time.Personally, I'm happy to stick with
14.xas the ternary rules can't autofix everything and there's a lot of fixes I'll need to make on my end.