-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
jsx-one-expression-per-line fix option inserts blank lines #1835
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
Comments
The indentation shouldn't need to be correct; the If you disable the |
No, see the comment at the bottom. The result is this:
|
Further note: using |
I had the same issue using prettier and prettier-eslint. Every time I saved, it created several new lines between the component and text. Below is my package.json since I'm not sure which package messed this up. "eslint": "5.5.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-babel": "5.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "7.11.1",
"eslint-config-prettier": "3.0.1",
"prettier": "1.14.2",
"prettier-eslint": "8.8.2",
"prettier-eslint-cli": "4.7.1" |
eslint랑 prettier쪽 문제인 거 같은데 원인을 모르겠음 jsx-eslint/eslint-plugin-react#1835 이 글의 댓글을 보고 따라했더니 고쳐짐
I am experiencing a similar problem:
results in ESLint giving me --fix gives me a similar result to @webOS101
and ESLint still complains If I wrap my content in a js string it works
|
This is still happening. |
@saiichihashimoto yep, that's why the issue's still open :-) it's got a "help wanted" label if you'd like to submit a PR to fix it. |
I got confused, I thought it was closed :-P |
Is there any update on this issue? I've met the same problem. I need to turn off this rule to pass the lint. : ( |
Looks like it's since been fixed. |
eslint-plugin-react 7.9.1
If the content of a tag contains only text, extra blank lines are inserted after the text (and the indentation is not correct). If the interior is a jsx expression, the output is correct.
results in:
.eslintrc:
Note: If you leave out
indent
it does not insert the extra spaces following the string content but does not indent any of the fixed code.The text was updated successfully, but these errors were encountered: