-
-
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
Add support for conditional rendering to jsx-multiline-wrap #1285
Conversation
FYI broken build doesn't seem to be related to this branch. Currently when I try to build master I get the same error messages, even though the latest build on travis for master was successful (21hrs ago: https://travis-ci.org/yannickcr/eslint-plugin-react/builds/250125668) |
docs/rules/jsx-wrap-multilines.md
Outdated
</div> | ||
``` | ||
|
||
The following patterns are not considered warnings when configured `{arrow: true}`. |
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.
do you mean {conditional: true}
?
I know that it'd require a bigger version bump, but to me it'd make more sense to have all the rules enabled by default. Also, while you're in there, feel like adding ternaries? |
Enabling rules by default should wait for a separate semver-major PR, released after the non-major changes are released. |
a223964
to
f7ca45f
Compare
*** sits wriggling with excitement waiting for the merge *** |
Sorry for the inconvenience; I've just merged a refactor to start using arrow functions. Would you mind rebasing? |
…line as the opening/closing JSX elements
f7ca45f
to
bbe67f9
Compare
Are there some problems regarding for this PR to be moved forward? I'd like to take a further look at this rule because I currently joined a project where we use a lot of conditional rendering and |
Seems like this was added in another PR, hence closing. To achieve this functionality, use the option: |
@jseminck sorry about the conflict :-) |
Main issue: #1282
I tried to make the fixer better so the output has the parens in the correct place. Probably, need to add a few more tests, but I think the current solution looks quite solid.
The rule is defaulted to
false
initially. If enabling it by default, a bigger version bump would be required?See also some comments on another issue regarding
jsx-multiline-wrap
: #1207 (comment)