-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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-indent rule #1852
Comments
This is on eslint 5; does it occur on eslint 4? |
this started happening when I switched from eslint 4 to 5. |
I have the same issue on eslint 4
I believe this is caused by the conflict between rule |
The indent rule has to be disabled for jsx nodes to be compatible with react/jsx-indent, fwiw. |
The above code still fails the lint with {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"plugins": [
"react"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"indent": ["off"],
"react/jsx-indent": ["warn", 2]
}
} eslint version: 4.19.1 |
I added a test case for the code in the issue description and it passed. I'm assuming this would be equivalent to having the |
@alexzherdev could we add that test case in a PR to close this issue? |
This is still happening to me on v5.10.0 If I initially enter:
Then using --fix turns it into:
It also happened more traditional < > < /> format. This:
was "fixed" to this:
Any explanation as to why this might still be happening? Apologies if I'm missing something. |
@RLesser we’re up to v7.11 - try updating to the latest. |
@ljharb Thought I had done that before, but I think I had a local/global issue. Looks like it is fixed now for me - thanks! |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? babel
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What did you expect to happen?
not fail. the code/ indents look ok.
What actually happened? Please include the actual, raw output from ESLint.
The text was updated successfully, but these errors were encountered: