-
Notifications
You must be signed in to change notification settings - Fork 887
Whitespace before curly braces #746
Comments
+1 This is really needed. Somewhat related is #628. |
+1. I like to enforce whitespace after function declarations
|
@adidahiya @jkillian I'd be interested in implementing this. What would your preference on syntax be? |
Edit: I just noticed that this is what @adidahiya suggested here. |
+1 also import statements. if trying to enforce:
over
or else you inevitably end up with
|
Hi guys, Is this still no possible? Regards. |
Any word on this? it would be really good for my team since we are migrating from a pure JS ESLinted with airbnb style guide, and the new TS code does not automatically do this for us. |
Of the 3 issues mentioned in the initial comment:
|
Whitespace rules around destructuring assignment and import / export statements, as @ollwenjones mentioned, is what I'm really after. You can achieve this today for TypeScript with |
Space after closing brace: Still not found the solution. |
The one I wanna fix is the |
@jcreamer898 the following rule will sort it out for you.
|
nice. thanks |
@shesko as far as I can see that rule isn't working. Is it working for you? (just to check it's not just me!) |
Sorry, this does work on 5.10.0, I just needed to upgrade |
Closing this as it seems to be fixed using the |
@whitecolor if you could, please don't post unrelated questions on old issues. This one was closed in July. StackOverflow and Gitter are better channels for miscellaneous TSLint questions. Your screenshot makes it look like you're using Prettier or a ruleset related to it, so you could start by checking your Prettier configuration. |
When check-branch is true, whitespace is required after an if / then, but not before a corresponding opening curly brace or after a closing curly brace.
As a result, we have an awkward scenario where check-branch only requires code to look like this:
In my experience, when teams want to enforce spaces after the branch, they also want to enforce spaces before the opening curly on line 2 and after the closing curly on line 4, like this:
In addition, there is no way to require
function(str){
to be formatted with whitespace asfunction (str) {
.Would pull requests adding this functionality be accepted? Any suggestions for naming those rule options?
The text was updated successfully, but these errors were encountered: