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

[New] jsx-max-props-per-line: add multi/single line config options #2769

Closed
wants to merge 0 commits into from

Conversation

iiison
Copy link
Contributor

@iiison iiison commented Aug 26, 2020

  • Update rule to accept different configs for single and multiline tags.
  • Update fixer for the same

Fixes #2735

@@ -32,22 +48,23 @@ ruleTester.run('jsx-max-props-per-line', rule, {
code: '<App foo />'
}, {
code: '<App foo bar />',
options: [{maximum: 2}]
options: [getConfigs(2)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not convinced this is clearer than just repeating each configuration inline. It's much harder for me to evaluate the test cases this way. Can you update this to remove getConfigs?

type: 'integer',
minimum: 1
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
},
"additionalProperties": false

(if i'm remembering the syntax right)

Comment on lines 26 to 28
maximum: {
type: 'integer',
minimum: 1
type: 'object',
properties: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a breaking change unless it uses anyOf or oneOf to allow both an integer and an object.

@ljharb ljharb changed the title Fix 2735 [New] jsx-max-props-per-line: add multi/single line config options Oct 15, 2020
@ljharb ljharb marked this pull request as draft October 15, 2020 17:52
@dherault
Copy link

dherault commented May 6, 2021

Is anyone working on this? Can I take a shot at it?

@iiison
Copy link
Contributor Author

iiison commented May 24, 2021

@dherault please go ahead. I'm a little busy with my office stuff.

@ljharb
Copy link
Member

ljharb commented May 24, 2021

@dherault please do not open a new PR - please post a link here to a branch/commit, and I'll update this PR.

@SIL0RAK
Copy link
Contributor

SIL0RAK commented Sep 21, 2021

Duplicate of #3078

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

Successfully merging this pull request may close these issues.

Is there any way to multiline all JSX props if there are more than X props on element?
4 participants