eslint-plugin-react: react/jsx-curly-spacing not working
For some reasons, I can’t get the jsx-curly-spacing rule to report errors.
After enabling it (using the default airbnb settings), I set several use case and nothing is reported.
The config has the following setting so all these cases should be reported, but they are not in my case.
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
{ something}
{something }
{ something }
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 36 (29 by maintainers)
I think that perhaps an option to
jsx-curly-spacingthat enabled checking of child curlies would be appropriate here?ESLint rules does not apply to
{something}here ? If not we should support it in this rule imho.Fixed in #1177
Each of the bugfixes is in a separate commit indeed. Separate PRs would mean some work on the tests (they are the most time-consuming), but I could do them if this would help.
Edit: oops, the first fix is mixed in with other things, unfortunately.
That’s up to @yannickcr
There were no tests for this behavior - I’ll add some.
Btw. I think there was a small bug: when only “spacing” was set in the extended options, the following line was setting “allowMultiline” to
undefined:Then in all the following conditions
!multilinewas being checked, which yielded a different result than the defaulttruevalue would.Now I’ll be checking if the property exists on the config object (using the
haspackage, I found it being used in other rules).Ok, so how about this:
Examples: