Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request OR length limitation problem #2324

Open
b5414 opened this issue Nov 2, 2024 · 0 comments
Open

Feature request OR length limitation problem #2324

b5414 opened this issue Nov 2, 2024 · 0 comments

Comments

@b5414
Copy link

b5414 commented Nov 2, 2024

Description

I want to get the Expected Output, how can I do it with your lib, without limitation by line length (due to this option broke another lines)

Probably Feature request: Make an option to count "&&" (or others), and if it more than 3 (any int value), then drop conditions like in the Expected Output // max_conditions_number: 3

Input

The code looked like this before beautification:

if ( foo == 123 && bar == 'foo' && very_long_name_of_function() && another_very_long_name_of_function() && long_variable_name && another_condition ) {
	test();
}

Expected Output

The code should have looked like this after beautification:

if ( foo == 123 &&
	bar == 'foo' &&
	very_long_name_of_function() &&
	another_very_long_name_of_function() &&
	long_variable_name &&
	another_condition 
) {
	test();
}

Actual Output

The code actually looked like this after beautification:

if ( foo == 123 && bar == 'foo' && very_long_name_of_function() && another_very_long_name_of_function() && long_variable_name && another_condition ) {
	test();
}

Steps to Reproduce

  1. Do beautification with settings

Environment

OS: win10

Settings

const cfg = {
	indent_size: 4,
	indent_char: ' ', 
	indent_with_tabs: true,
	editorconfig: false,
	eol: '\n', 
	end_with_newline: true, 
	indent_level: 0,

	preserve_newlines: true, 
	max_preserve_newlines: 2,

	space_in_paren: true, 
	space_in_empty_paren: false,

	space_after_anon_function: true, 
	space_after_named_function: false,

	indent_empty_lines: true,

	wrap_line_length: 170, 
	operator_position: 'before-newline', 

	comma_first: false, 
	jslint_happy: false, 
	
	brace_style: 'collapse',
};

ps: Gitter is dead (link and people), please make discord or some

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant