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

Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly enhancement This change enhances an existing feature of ESLint indent Relates to the `indent` rule

Comments

@golopot
Copy link
Contributor

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.

@golopot golopot added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules triage An ESLint team member will look at this issue soon labels Sep 3, 2019
@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly and removed enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Sep 3, 2019
@kaicataldo
Copy link
Member

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

@kaicataldo kaicataldo added enhancement This change enhances an existing feature of ESLint indent Relates to the `indent` rule and removed rule Relates to ESLint's core rules labels Sep 3, 2019
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 19, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.