Skip to content
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

Fix jsx-indent bug on multiline ternary #950

Merged
merged 1 commit into from
Nov 11, 2016
Merged

Fix jsx-indent bug on multiline ternary #950

merged 1 commit into from
Nov 11, 2016

Conversation

voxpelli
Copy link
Contributor

@voxpelli voxpelli commented Nov 7, 2016

This PR is an attempt at fixing #945.

I'm no master at ESLint or it's parser, but adding some new tests and looking at the AST and figuring out what it would take to make the new test pass while not breaking the tests from d88ee37 gave the following solution.

I also ran this version of the module against my large react project and all errors that occurred with 6.6.0 was then gone.

@Jessidhia
Copy link
Contributor

This (unfortunately) won't deal with this, still requiring that the <span/> start on column 2:

cond
  ?
    <div/>
  :
    <span/>

Though not supporting even the case where you use parens is certainly the bigger evil.

@yannickcr yannickcr merged commit e60921c into jsx-eslint:master Nov 11, 2016
@yannickcr
Copy link
Member

Merged, thanks!

@voxpelli voxpelli deleted the fix-multiline-ternary-indent branch July 25, 2020 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants