Skip to content

Trailing comma can mess up subsequent indentation #491

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

Closed
markrian opened this issue Jun 17, 2016 · 5 comments
Closed

Trailing comma can mess up subsequent indentation #491

markrian opened this issue Jun 17, 2016 · 5 comments

Comments

@markrian
Copy link

I haven't really characterised this fully, but it seems that a trailing comma in an array literal can mess up subsequent block indentation. Using the latest commit on develop (ea58033), it indents the following code like so:

var whatever = [
    'an item',
    'note the trailing comma',
].map(() => {
        anythingHere();
});

If you remove the trailing comma, you get this:

var whatever = [
    'an item',
    'note the LACK of a trailing comma'
].map(() => {
    anythingHere();
});

which is how I'd expect the code to indented.

@markrian
Copy link
Author

The most recent commit which doesn't exhibit this bug happens to be exactly v1.0.0 (d7f4728).

@bounceme
Copy link
Collaborator

bounceme commented Jun 17, 2016

dev branch!
edit:never mind haha

@markrian
Copy link
Author

I'm not sure what you meant by that comment - was I right to file an issue against the develop branch?

@bounceme
Copy link
Collaborator

I thought it was fixed already, this is still a problem but i'll try and fix it for the next push to master.

bounceme added a commit that referenced this issue Jun 18, 2016
seems to fix #491, may be necessary to look for a more complex solution if this causes regressions
bounceme added a commit that referenced this issue Jun 18, 2016
seems to fix #491, may be necessary to look for a more complex solution if this causes regressions
@amadeus
Copy link
Collaborator

amadeus commented Jun 18, 2016

Has this issue been fixed on develop?

@amadeus amadeus closed this as completed Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants