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

collapse-preserve-inline does not preserve simple, single line ("return") statements #982

Closed
octavian-nita opened this issue Aug 3, 2016 · 1 comment
Milestone

Comments

@octavian-nita
Copy link

Hi guys,

As indicated, when using "brace_style": "collapse-preserve-inline" in .jsbeautifyrc, simple, single-line statements don't seem to always be preserved. At least one such case is when the 'simple' statement is a return: for a function definition such as

function foo(arg) {
  if (!arg) { return false; }
  // ...
  return true;
}

I get (after beautifying)

function foo(arg) {
  if (!arg) {
    return false; }
  // ...
  return true;
}

whereas I would have expected no change in the input.

Needless to say, I am using the latest version of js-beautify.

@bitwiseman
Copy link
Member

yes, this is a bug, there are some places where they are not preserved. Mostly due to specific keywords.

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

No branches or pull requests

2 participants