-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Space after function keyword - MOVED to #3847! #1139
Copy link
Copy link
Closed
Labels
lang:javascriptIssues affecting JSIssues affecting JS
Description
I apologize in advance if this has been discussed before (I did a quick search and didn't find it). One of the things that popped out when running prettier over our codebase was spacing on anonymous functions.
For example, prettier converts this:
function foo() {
this.bar = function () {
console.log('baz');
}
}into this:
function foo() {
this.bar = function() {
console.log('baz');
}
}While this pattern is becoming less common for us (we'd probably use an arrow function here now), we still have several cases of this. The lack of space after the function keyword just doesn't read right for me. It probably has to do with one or more of the following:
- It looks more like a function invocation than a declaration.
- The lack of space after a keyword is odd.
For prior art:
- https://github.com/airbnb/javascript#functions--signature-spacing
- http://eslint.org/docs/rules/space-before-function-paren
- http://eslint.org/docs/rules/space-after-keywords
Are there strong feelings on this one?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JS