-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
-
-
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
[feature request] react/jsx-newline #3033
Comments
Can you give an example of a single-line component? I'm having trouble imagining when a component would be so simple that it's best expressed as a single line. |
I realise now an example would have helped, here it is:
I was more talking about JSX expressions than components, sorry again for the confusion. |
ahhh ok, thanks. That sounds like a great option to me. |
Would anyone be up to help me tackle this? |
I'm happy to review a PR, and give guidance if you have specific questions. |
Hi @ljharb, I'd like to work on this! |
Just to clarify, when |
@TildaDares go for it! I think we'd want to keep the same behavior by default, but add a new option that ignored single-line jsx expressions. |
Thanks @ljharb! I'm not sure I'm on the right track but I tried adding a new option like this: properties: {
prevent: {
default: false,
type: 'boolean',
},
allowMultilines: {
type: 'boolean',
},
}, But I got this error:
How do I configure the |
This was a mistake on my part. The
|
Hi,
I would find it interesting to provide a new option to the react/jsx-newline rule, so that there is a newline between JSX expressions ONLY if they are multiline.
I find that single line JSX expressions are easier to read and don't require a space between them, but multiline expressions can quickly become hard to read.
Would anyone be eager to help me implement this feature, as this would be the first rule I would contributing to the project?
Thanks in advance!
The text was updated successfully, but these errors were encountered: