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

Object 'shorthand' incorrectly applying space #71

Open
stweedie opened this issue Mar 17, 2016 · 1 comment
Open

Object 'shorthand' incorrectly applying space #71

stweedie opened this issue Mar 17, 2016 · 1 comment

Comments

@stweedie
Copy link

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

@ilanbiala
Copy link
Collaborator

If this is ES6, I'm not sure if it's supported. JS-Beautify is our formatting engine, so it needs to be supported by that for it to work.

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

2 participants