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

jsx-alignment could be split into multiple rules #100

Closed
radix opened this issue Jun 13, 2017 · 5 comments
Closed

jsx-alignment could be split into multiple rules #100

radix opened this issue Jun 13, 2017 · 5 comments
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier P2 Type: Rule Suggestion

Comments

@radix
Copy link

radix commented Jun 13, 2017

jsx-alignment has multiple behaviors:

  • in a multiline tag, the props must start on a separate line from the tag
  • in a multiline tag, each prop must be on its own line
  • in a multiline tag, the > must be on its own line

(there may be more that I'm missing)

It might be nice to make separate rules for these checks.

@kenjiru
Copy link

kenjiru commented Sep 25, 2017

That's a great idea, as I'm not a big fan of the last rule, with > being on it's own line..

@nksfrank
Copy link

I'd like to see this, too. I like to have the closing > on the same line as the last prop

@olee
Copy link

olee commented May 16, 2018

Anyone intending to write up a PR to this one?
I would really like to split tags in multiple lines, but still allow multiple tags in the same line.

@onlywei
Copy link

onlywei commented Dec 19, 2018

The way eslint's react plugin does this is with multiple rules, which I really like. What I'm looking for is the ability to do this:

<SomeElement
    prop1="foo"
    prop2="bar">
  child contents
</SomeElement>

Meaning the attributes of the element are indented 4 spaces, while the child contents are only indented 2.

@adidahiya adidahiya added Type: Rule Suggestion P2 Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier labels Jan 15, 2019
@adidahiya
Copy link
Contributor

Closing due to #210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier P2 Type: Rule Suggestion
Projects
None yet
Development

No branches or pull requests

6 participants