In an effort to make progress on the oldest JavaScript zombies, I've been offering as much of a review as I'm capable of, based on the content, or the quality of the code, or sometimes, the amount of time that I have available. Even if I can say more, I often leave that to another (more capable) reviewer and move onto another review: "Share the Rep. Team up on a review."
Well, when the code looks great, sometimes there's nearly nothing to suggest.
In this case, I thought the code was written very well, but it didn't seem to follow a few of the conventions that I read and observed in Douglas Crockford's Article on JavaScript formatting conventions. So I walked the user through a few of the changes suggested and demonstrated in Crockford's article.
On my answer, a user comments that I should not suggest formatting changes unless they damage readability or cause confusion.
As long as everyone involved in the maintenance of this code agrees that this is how they want it formatted, then there is no mistake. Nitpick about formatting when its inconsistent or significantly impacts readability, not because its in a style that differs from your own.
Is it always ok to suggest best formatting practices on code that doesn't follow popular conventions? Or should I not submit these formatting improvement suggestions?
var
is not a style thing, it's just plain wrong. It won't work in strict mode or ES6 and there is absolutely never a reason to do it, outside of extreme edge cases like code that's going to get combined with some other code at build time where the variable is declared properly. \$\endgroup\$