You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I want to search where has called xxx function globally, you will find that the definition and the usages will appear at the same time, which will disturb me. But if there is white space after xxx, like xxx (), we can easily separate the definition and the invokation (usage).
So, the adding a space after function name will be more convenient and it's the best practice I think.
Thanks for bringing this up. I think it could be reasonable to some extent, but this thing is still opinionated in the end. I don't really have a strong opinion over which, but as this will affect a lot of existing code, I'd prefer to keep it as-it to reduce noises.
Clear and concise description of the problem
Main opinion
When defining a function,
is better than
Example
Let's say I have 3 files.
If I want to search where has called
xxx
function globally, you will find that the definition and the usages will appear at the same time, which will disturb me. But if there is white space afterxxx
, likexxx ()
, we can easily separate the definition and the invokation (usage).So, the adding a space after function name will be more convenient and it's the best practice I think.
Suggested solution
Enable https://eslint.org/docs/latest/rules/space-before-function-paren.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: