js-beautify
js-beautify copied to clipboard
What does "good-stuff" do?
There should be clearer documentation about "good-stuff" option.
What does it do? At least approximately.
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
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.
Nuking the option is also a viable choice. That would be a breaking change, which would need to wait to the next version.
+1 on adding unindent-case
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 PRs welcome.