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-max-props-per-line: different value for oneline tags and multiline tags #410

Closed
janmarek opened this issue Jan 26, 2016 · 5 comments
Closed

Comments

@janmarek
Copy link

Hi, I write JSX like this.

// ok
<Component prop1="val" prop2="val" />
<Component 
    prop1="val" 
    prop2="val" 
/>

// not ok
<Component 
    prop1="val" prop2="val" 
/>

Currently it is not possible to set jsx-max-props-per-line differently for multiline tags.

@nevir
Copy link

nevir commented Mar 3, 2016

I would also be interested in this

@ljharb
Copy link
Member

ljharb commented Mar 3, 2016

this seems totally reasonable - i also require either all props + component on one line, or, never more than one thing on the same line.

@rjokelai
Copy link

+1 I'd like to see this, too

@mwilliamson-healx
Copy link

I've probably missed something, but I'm still not sure how to enforce this. jsx-first-prop-new-line makes sure that the first prop is on a new line, but doesn't enforce anything about later props. jsx-max-props-per-line still applies equally to single-line and multi-line tags.

@shirotech
Copy link

shirotech commented Dec 1, 2018

+1 IMO this is a very reasonable rule to have, any multiline props with more than 1 is not scannable

Would like to see a combination of {maximum: 3, when: 'not-multiline'} and {maximum: 1, when: 'multiline'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants