js-beautify icon indicating copy to clipboard operation
js-beautify copied to clipboard

What does "good-stuff" do?

Open karelbilek opened this issue 10 years ago • 6 comments

There should be clearer documentation about "good-stuff" option.

What does it do? At least approximately.

karelbilek avatar Mar 19 '15 15:03 karelbilek

You're right, it should be better documented.

It currently sets two behaviors that make jslint happy: case un-indenting and space_after_anon_function.

They are shown here: https://github.com/beautify-web/js-beautify/blob/master/js/lib/beautify.js#L50

bitwiseman avatar Mar 19 '15 22:03 bitwiseman

I suggest nuking this option and using two separate parameters to control each behaviour. Trying to lump both under one seriously ambiguous option named --good-stuff (with an even less informative description) is counter-intuitive.

A setting named unindent-case is much more explicit.

Alhadis avatar May 28 '15 04:05 Alhadis

Nuking the option is also a viable choice. That would be a breaking change, which would need to wait to the next version.

bitwiseman avatar May 28 '15 18:05 bitwiseman

+1 on adding unindent-case

adrianschmidt avatar Jul 20 '15 05:07 adrianschmidt

Apparently it does more then this.

// test.js file
const a = [
    "foo",
      "bar"
];
~$ js-beautify test.js 
const a = [
    "foo",
    "bar"
];
~$ js-beautify --good-stuff test.js 
const a = [
    "foo",
      "bar"
];~$

finalclass avatar Dec 24 '21 07:12 finalclass

@finalclass PRs welcome.

bitwiseman avatar Apr 05 '22 07:04 bitwiseman