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
[Bug]: react/jsx-newline
does not remove empty lines for surrounding tags
#3663
Comments
react/jsx-newline
does not remove empty lines for surrounding tags
Works as expected? The rule adds/removed newlines between adjacent JSX elements and expressions. That being said, it might be reasonable to add option to also check newlines at start and end of element's children 🤔 |
I think it's a reasonable interpretation that To avoid a breaking change, we'd need to add a new option for this. |
Is there an existing issue for this?
Description Overview
react/jsx-newline
with{ "prevent": true }
does not remove empty lines for surrounding tags.Currently
react/jsx-newline
does not detect any lint errors for the following JSX:Expected Behavior
The current detection feels like unintended behavior, as I would expect all newlines within JSX to be removed as follows:
If there is a different eslint rule that checks for this please let me know!
eslint-plugin-react version
v7.33.2
eslint version
v8.55.0
node version
v18.6.0
The text was updated successfully, but these errors were encountered: