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
Extend react/jsx-props-no-multi-spaces to catch extra line breaks. #2223
Comments
That sounds reasonable - want to make a PR? |
is someone working on this? |
nope, go for it. |
so, as far as I understand, we need to add auto-fixing functionality to this plugin? |
@iiison this issue is for adding additional warnings to the rule. Separately, it would be ideal to maximize what can be safely autofixed. |
It's still not auto fixing extra line breaks Am I missing something? |
It isn’t supposed to; it just warns on them. |
I actually am not a fan of this change, since it disallows comments over certain props in multiline jsx code. Leading to lots of ugly code like this: <MyComponent
someProp
// Some comment about a prop's usage
// eslint-disable-next-line react/jsx-props-no-multi-spaces
someOtherProp
/> As opposed to this: <MyComponent
someProp
// Some comment about a prop's usage
someOtherProp
/> @jsphstls stated in his original posting:
But the PR that was merged actually doesn't introduce any autofixing benefits. In my opinion #2756 should be reverted, or barring that, we should allow the user to configure a maximum number of allowable line breaks in multiline components. |
Actually though, this isn't really necessary since |
@roryabraham that seems like a reasonable option to add, if you wanted to send a PR with lots of test cases. |
I was unable to find a rule that would prevent this and I think
react/jsx-props-no-multi-spaces
would be the most relevant one to extend. The issue is not that people would really do this. Instead, the goal is to improve the autofixing benefits of an existing rule with a hopefully minor adjustment.The text was updated successfully, but these errors were encountered: