Skip to content

Trailing comma can mess up subsequent indentation #491

Closed
@markrian

Description

@markrian

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions