-
-
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
Rule for enforcing max 1 prop per line only when tag spans multiple lines #878
Comments
What you want would exactly match Airbnb's indentation style, so I'm a strong +1 for this. |
Cool. I have an implementation. The issue is with naming, and it's also possible for this rule to conflict with Another option is to extend |
Should this be an option of |
We could have an option on max-props-per-line to kick in only when tag spans multiple lines. But there's still the issue of enforcing the first prop to be in a new line when there are multiple props and the tag spans multiple lines. |
We may want to do a number of these things. We should definitely have an option on max-props-per-line to kick in only when the tag spans multiple lines. If we then still need another rule or option, that's fine. |
There should be a rule that activates
max-props-per-line
(with maximum: 1) only when the JSX element spans multiple lines. Furthermore, it should enablejsx-first-prop-new-line
only when there are more than 1 prop.Valid:
Invalid:
The current rules
jsx-max-props-per-line
andjsx-first-prop-new-line
are not enough to enforce this.The text was updated successfully, but these errors were encountered: