-
-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
offsetTernaryExpressions and multiline-ternary conflicts with jsx/indent (standard-react) #177
Comments
Oh hello fellow traveler, I was just about to open this issue. Bitten by this today. |
I think the idea here would be to disable the indent rule for JSX, which is covered by standard jsx. Disable: Though I don't know if there are any assumptions regarding indent applying to jsx nodes and properly overlapping. Sending in a PR to see what people think. |
bcomnes
added a commit
that referenced
this issue
Oct 27, 2020
Fixes #177 My only worry is that there is some use for indent rules inside of JSX that are intended to overlap with standard-jsx? Not sure, anyone familiar?
Fixed in 15.0.1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 forindent
rule 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-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.
What did you expect to happen?
Both
standard
andstandard-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/orjsx/indent
. DisablingoffsetTernaryExpressions
andmultiline-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.The text was updated successfully, but these errors were encountered: