-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[New]jsx-newline
: Enforce a new line after jsx elements and expressions
#2693
Conversation
e95d6dc
to
2c384c1
Compare
e610135
to
2186b4f
Compare
I don't get why the README generation of the build is failing. I need help. |
@jzabala the autogeneration isn't failing; you have to manually add it, and the autogeneration validates that you added it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure all the test cases are ran in the default parser, babel-eslint, and the typescript parser.
<IconPreview /> | ||
Button 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this not a warning? there's no newline after the element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Good part of the issue description the same example is giving without a newline. That is why the rule only warns about newlines between elements and expressions, no literals like text and numbers.
f95a649
to
f6e889e
Compare
Fixed. Thanks.
Done. Hi @ljharb. I addressed all your comments. Thanks for taking the time to review the PR 🙂 |
4b9ce4b
to
6da5e19
Compare
6da5e19
to
32d3d16
Compare
jsx-newline
: Enforce a new line after jsx elements and expressions
@rumenpetrov can you confirm that this rule will meet your needs? |
@jzabala @ljharb thank you for your great work. The PR almost covers my needs. I just have a remark about the case where we have text along with other components. I didn't provide enough details last time on how it should be implemented, so this is on me, sorry about that. I will try to clear it now. When there is a text as a child of a parent component I don't need the new lines for its children. I need the new lines only when the children are other components and there is no text. Bad
Good
Also, I am not really sure how to test this PR locally or with a real project. @jzabala can you point me to a documentation page or an article related to this? |
Don't want to annoy anyone but does somebody know if PR is still in the process of being merged? I REALLY want this rule. It would save a lot of time of my team |
32d3d16
to
8867490
Compare
Closes #2630