-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
jsx-one-expression-per-line should ignore inline elements #1848
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
jsx-one-expression-per-line should ignore inline elements #1848
Comments
In that particular case i agree it looks messy; I’m not sure how to generically allow it when it’s inline with text without having things like long links be inlined. |
Had a similar experience when bumping up to 7.10:
becomes
which are among the simpler of 100+ areas of code base that had to be changed. It's the simpler JSX though that should be able to be kept inline IMO. I think maybe an inline option in conjunction with ESLint's I like the new rule and want to be able to enforce it in some way, but in its current state it's just overkill and actually has a negative impact on code appearance for what is essentially a purely stylistic rule. |
See #1855; I think they're related. |
Somewhat, but sort of a different concern. I left feedback there as well. |
@Mindaugas-Jacionis two things that relate to each other, cross-referencing each other, shouldn't be confusing. |
I recently had to disable
Result:
What I want to prevent is someone trying to inline nested tags. I don't care about people using |
Agreed. In addition, running |
I'm also very unhappy of Airbnb's style guide asking for that. I have the exact same case:
I'm required to split up the I'm disabling it for now. |
As a temporary workaround, until jsx-eslint/eslint-plugin-react#1848 is fixed.
As a temporary workaround, until jsx-eslint/eslint-plugin-react#1848 is fixed.
This had messed up our pages with content. Text is missing meaningful spaces. |
Some occurrences left due to rule making code less readable (see jsx-eslint/eslint-plugin-react#1848) Rule remains globally disabled
Some occurrences left due to rule making code less readable (see jsx-eslint/eslint-plugin-react#1848) Rule remains globally disabled
Some occurrences left due to rule making code less readable (see jsx-eslint/eslint-plugin-react#1848) Rule remains globally disabled
Right now, it's making code harder to read. See: jsx-eslint/eslint-plugin-react#1848
Right now, it's making code harder to read. See: jsx-eslint/eslint-plugin-react#1848
Some occurrences left due to rule making code less readable (see jsx-eslint/eslint-plugin-react#1848) Rule remains globally disabled
Any update on this? |
See #1848 (comment) |
This is very annoying... 😞 |
how did you that? |
Agree this can hinder readability and an allow inline option is needed. Disabling rule for now. |
At least tags like <b> and <em> should be ignored to start with... |
What's the solution? Add an option like |
I'm not sure we have a solution yet - but it'd be great if someone wanted to propose one. |
It doesn't seem to make sense to one-line inline elements.
For example, one-lining the
em
element in the example below doesn't make sense.Here is the "fixed" version.
I could also see an option allowing the developer to choose which elements to ignore along with an
ignoreInline
option.The text was updated successfully, but these errors were encountered: