-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
react/jsx-closing-bracket-location
not working
#31
Comments
This appears to fix the problem: 'react/jsx-closing-bracket-location': [
'error',
{
- nonEmpty: 'tag-aligned',
+ nonEmpty: 'line-aligned',
selfClosing: false
}
], |
That allows for code like this though: var x = function() {
return <Say
firstName="John"
lastName="Smith"
>
Hello
</Say>;
}; |
Are you sure this is just not a bug/limitation in the rule? |
Yes, there is a limitation in the rule which means |
But neither can |
I think you should open an issue |
To clarify: the rule was originally written with the airbnb config in mind, which requires parens around multiline jsx, so you'd always write it like this, whether you're using spaces or tabs: var x = function() {
return (
<Say
firstName="John"
lastName="Smith"
>
Hello
</Say>
);
}; There's likely to be edge cases for scenarios that weren't holistically considered. (Further discussion about closing-bracket-location can happen on the linked issue) |
Currently, the rule requires tags to be aligned:
eslint-config-xo-react/index.js
Lines 86 to 92 in e29b624
In this situation, no amount of tabs would achieve that (line 6):
7 spaces worth of space are needed which can't be represented in tabs.
The text was updated successfully, but these errors were encountered: