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

Can't Nest Conditionals #219

Closed
loganknecht opened this issue Apr 24, 2015 · 1 comment
Closed

Can't Nest Conditionals #219

loganknecht opened this issue Apr 24, 2015 · 1 comment

Comments

@loganknecht
Copy link

Hello!

I'm having an issue with my code where I want to nest conditional logic for better readability, however upon saving it causes the conditionals to be inlined together.

For example this is how I want the code to look

if((!_.isNull(jqXHR.responseJSON) && !_.isUndefined(jqXHR.responseJSON)) 
   && (!_.isNull(jqXHR.responseJSON.errMessage) && !_.isUndefined(jqXHR.responseJSON.errMessage))) {
    signup_error_field.html(jqXHR.responseJSON.errMessage);
} else {
    signup_error_field.html('An Unexpected Error Occurred:\n' + error_thrown);
}

But, when I save it formats it to this

if((!_.isNull(jqXHR.responseJSON) && !_.isUndefined(jqXHR.responseJSON)) && (!_.isNull(jqXHR.responseJSON.errMessage) && _.isUndefined(jqXHR.responseJSON.errMessage))) {
    signup_error_field.html(jqXHR.responseJSON.errMessage);
} else {
    signup_error_field.html('An Unexpected Error Occurred:\n' + error_thrown);
}

I tried changing multiple settings, however I wasn't able to really configure it such that it would match the desired style.

Is there a setting that would afford me this ability that I'm unaware of?

@victorporof
Copy link
Owner

Please file this bug at https://github.com/beautify-web/js-beautify

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

2 participants