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

Certain keywords preceded or followed by a new line. #7

Open
viskenxp opened this issue Jan 23, 2014 · 2 comments
Open

Certain keywords preceded or followed by a new line. #7

viskenxp opened this issue Jan 23, 2014 · 2 comments

Comments

@viskenxp
Copy link

It would be nice if you could configure certain lines that start with a keyword (if/return/etc) to have either an empty line preceding and/or following that line/construct.

Good:

  val = 1;  

  return val;
}

Bad:

  val = 1;
  return val;
}

Good:

if (val === 1) {
  console.log(val);
}

With an override for all first lines in a function/if/switch/... block.

function() {
  if (val === 1) {
    console.log(val);
  }
}();

Bad:

if (val === 1) {
  console.log(val);
}
@dsheiko
Copy link
Owner

dsheiko commented Jan 24, 2014

Trying to get this logic.Within a specified block statement (compound statement if/else/for/while/try/.. or function scope) the ReturnStatement must be always preceding by a line-break?

@viskenxp
Copy link
Author

Yes, unless it is the first line in that block statement.

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