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

Indent does not handle JSX fragment #12208

Comments

@golopot
Copy link
Contributor

@golopot golopot commented Sep 3, 2019

What rule do you want to change?
indent
Does this change cause the rule to produce more or fewer warnings?
more
How will the change be implemented? (New option, new default behavior, etc.)?
New option or new default behavior.
Versions
eslint 6.3.0
Parser
espree
Please provide some example code that this change will affect:

/* eslint indent: [2, 2] */

function Foo () {
  return (
<>
{' '}
</>
  )
}

https://eslint.org/demo#eyJ0ZXh0IjoiLyogZXNsaW50IGluZGVudDogWzIsIDJdICovXG5cbmZ1bmN0aW9uIEZvbyAoKSB7XG4gIHJldHVybiAoXG48PlxueycgJ31cbjwvPlxuICApXG59XG4iLCJvcHRpb25zIjp7InBhcnNlck9wdGlvbnMiOnsiZWNtYVZlcnNpb24iOjksInNvdXJjZVR5cGUiOiJtb2R1bGUiLCJlY21hRmVhdHVyZXMiOnsianN4Ijp0cnVlfX0sInJ1bGVzIjp7fSwiZW52Ijp7fX19

What does the rule currently do for this code?
Does not handle indent of anything in JSXFragment. In contrast indents in normal jsx elements are handled properly.
What will the rule do after it's changed?
Handle indents in jsx fragments.
Are you willing to submit a pull request to implement this change?
No.

@kaicataldo

This comment has been minimized.

Copy link
Member

@kaicataldo kaicataldo commented Sep 3, 2019

I've verified this and think we should treat it as a bug. I'm working on this!

kaicataldo added a commit that referenced this issue Sep 3, 2019
kaicataldo added a commit that referenced this issue Sep 3, 2019
@kaicataldo kaicataldo added enhancement indent and removed rule labels Sep 3, 2019
kaicataldo added a commit that referenced this issue Sep 20, 2019
@eslint eslint bot locked and limited conversation to collaborators Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.