-
Notifications
You must be signed in to change notification settings - Fork 889
Support else / catch on next line #12
Comments
I can toggle it with the I think it should be split to it's own rule: it is not the same thing as oneline's "opening brace to be on the same line as the expression preceding it". |
sure, makes sense. |
made all checks optional, fixed by 5cd203a |
It would be great if next-line braces was a rule as well. Solving it by ignoring the "oneline" rule is not ideal. |
Can you give us an example of what you mean, @eirikhm? If you want your braces to be on the next line, why do you want to one-line rule enabled at all? |
Let me clarify: I'd like a rule which checks if braces are on the next line, and that it complains if they are on the same line. As far as I could tell there is no way to enforce this. |
Is there any way to enforce the opposite of
and restrict the following style:
EDIT - this can be accomplished with tslint-eslint-rules |
Agreed, why not add the inverse to force blocks to their own line? |
This is a very common requirement - I've just found out it's not supported in tslint and I'm a bit surprised... I thought this was exactly the type of thing tslint was for? |
Aww that's almost a bit sad :( lol |
It should be possible to enforce the position of trailing block headers like else/catch statements:
Currently this is expected:
Otherwise you get the 'misplaced else' warning.
But we want the trailing block bumped a line like this::
Or for try/catch
An all other similar structures.
We find it easier to read as the keyword is tight on the left margin and the closing brace's position enforces a nearly blank line, just like in the starting block.
The text was updated successfully, but these errors were encountered: