Skip to content
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

Unexpected indentation for Lodash method body inside JSX #857

Closed
broadhu2 opened this issue Apr 12, 2017 · 1 comment

Comments

@broadhu2
Copy link

commented Apr 12, 2017

I ran standard --fix and there seems to be an issue with indentation inside a JSX block that uses a lodash method. Screenshot shows code before running standard --fix on the left and after on the right.

standard fix issue

Can you explain why this happens?

@feross

This comment has been minimized.

Copy link
Member

commented Apr 13, 2017

standard requires that you use spaces for indentation, not tabs. When you ran standard --fix most of the indentation was replaced by spaces, but it looks like it failed to indent the code inside the JSX block correctly. It left tabs (represented by arrows) on the first and last lines of the JSX block, but replaced the inner line's tabs with spaces (represented by dots).

This is a bug in ESLint's indent rule. However, ESLint just finished a brand-new rewritten indent rule that will be part of ESLint 4.0.0. However, that version is still in alpha at this time. This will be fixed in a future version of standard when we update to ESLint 4.0.0.

You can follow this issue to know when this is fixed in standard: #735

@feross feross closed this Apr 13, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.