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:
Are there strong feelings on this one?
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:
into this:
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:
For prior art:
Are there strong feelings on this one?