Atom-beautify: Alignment with Atom-Alignment

Created on 21 Aug 2015  路  6Comments  路  Source: Glavin001/atom-beautify

I use atom-alignment to align my code.
But I use atom-beautify with the Beautify On Save function (JS Beautify). Atom-beautify alignment "break". Solution?
Thanks

question

All 6 comments

Please provide additional debugging information by following the steps here: https://github.com/Glavin001/atom-beautify/blob/master/CONTRIBUTING.md#new-issues-bugs-questions-etc

@jeromevvb JS Beautify is the default beautifier for JavaScript in the atom-beautify package, but the package also includes Pretty Diff which has its own JavaScript beautifier. Check and see if this vertical alignment is kind of what you are looking for:

  • Go to http://prettydiff.com/?m=beautify
  • Scroll down or search the page for option (vertical)
  • Ensure the radio button for Vertically align CSS/JS is checked.
  • Test out your code at the top of the page.

The vertical alignment supports:

  • A list of assignments
  • Object properties
  • Is multidimensional

What it does not support is:

  • comma separated expressions

@prettydiff Where can I configure this option in the settings ? Thanks!

Here are all of the documented options: https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md
I recommend using the Atom Beautify package settings and finding the options you want. There are a lot.

To switch from JS Beautify to Pretty Diff use Language Config - JavaScript - Default Beautifier: https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md#language-config---javascript---default-beautifier

The vertical option for Pretty Diff is called align_assignments in Atom Beautify: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/prettydiff.coffee#L24
You can set it in your .jsbeautifyrc file with something like:

{
"js": {
"align_assignments": true
}
}

where is the .jsbeautifyrc?

Closing as this issue is likely resolved.

@kfird214 https://github.com/Glavin001/atom-beautify/blob/master/src/.jsbeautifyrc

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  4Comments

philippelesaux picture philippelesaux  路  4Comments

callmeyesh picture callmeyesh  路  3Comments

edwardm picture edwardm  路  5Comments

PolGuixe picture PolGuixe  路  3Comments