Skip to content

Object 'shorthand' incorrectly applying space #71

@stweedie

Description

@stweedie

Formatting files that use object 'shorthand' notation will result in weird object spacing.

For instance,

var foo = 0;
var object = {
  foo,

  bar: 1,
  baz: 2
};

will format to

var foo = 0;
var object = {
  foo,

  bar: 1,
    baz: 2
};

where the 'baz' property (and all further properties) will have one additional level of indent. Commenting out the 'foo' property or not using shorthand will produce expected results, so

var foo = 0;
var object = {
  foo: foo,

  bar: 1,
  baz: 2
};

Airbnb's style guide for more information

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