Hirse / brackets-beautify

Brackets Extension to beautify JavaScript, HTML, and CSS files.
MIT License
34 stars 3 forks source link

Can we prevent beautify from correcting the comma-first style of authoring the JavaScript Object Literal? #15

Open shardool opened 8 years ago

shardool commented 8 years ago

Can we prevent beautify from changing

var Person = {
  firstName : 'Bob'
  ,lastName: 'Connor'
  ,homeTown:'Dairy'
};

to

var Person = {
  firstName : 'Bob',
  lastName: 'Connor',
  homeTown:'Dairy'
};
Hirse commented 8 years ago

The used library has a command-line option to use that style: https://github.com/beautify-web/js-beautify#options However in their README this is not documented for the .jsbeautifyrc-settings file. You could try to add it as

"comma_first": true

If that doesn't work, please open an issue on their GitHub.