Replies: 3 comments 2 replies
-
Duplicate of #982 |
Beta Was this translation helpful? Give feedback.
-
it would be a nice option to have. it's a basic visual guide in javascript to mark the difference between invocation and declaration. but it also feels fairly prone to bike-shedding, especially when you look at typescript declarations that include generics. the argument boils down to are generics part of the parameter group? or are they part of the function name? and people definitely disagreed in the old prettier discussions: function foo <T>(arg: T): T { }
function bar<T> (arg:T): T { }
function baz<T>(arg:T): T { } i'm personally in favor of including a space after the name in a declaration—including ts functions with generics—since it allows for searching for the declaration when your editor's goto definition function is broken or otherwise unavailable. and the reality is i spend a good chunk of my time searching code in adverse conditions (github search, grepping, etc) and that difference is often helpful also, i have to say it's frustrating that prettier just filibustered on the issue long enough, and their style propagated far enough in the last several years, that, like a circular wikipedia citation, they can point to the current "agreement" in the community as a reason to never budge |
Beta Was this translation helpful? Give feedback.
-
I know new formatting rules are unlikely to be considered, but having a space before function parenthesis is widely used.
https://eslint.org/docs/latest/rules/space-before-function-paren
Beta Was this translation helpful? Give feedback.
All reactions