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

Multi-line ternary is not indented if in function call

Open kasvtv opened this issue 5 years ago • 1 comments

Input

The code looked like this before beautification:

true
	? true
	: false;

console.log(
	true
		? true
		: false
);

Expected Output

The code should have looked like this after beautification:

true
	? true
	: false;

console.log(
	true
		? true
		: false
);

Actual Output

The code actually looked like this after beautification:

true
	? true
	: false;

console.log(
	true
	? true
	: false
);

Settings

Example:

{
	"indent_with_tabs": true,
	"indent_size": 4,
	"operator_position": "after-newline",
	"max_preserve_newlines": 3,
	"preserve_newlines": true,
	"space_before_conditional": true,
	"space_in_empty_paren": false,
	"unescape_strings": true,
	"wrap_line_length": 0,
	"brace_style": "collapse,preserve-inline",
	"extra-liners": []
}

kasvtv avatar May 25 '19 23:05 kasvtv

Thanks!

bitwiseman avatar May 26 '19 00:05 bitwiseman