• I have read through guide on wiki, as well as jshint config,
    but there are few differences between the project's code and guide lines.

    Most noticeable are:

    1. Oneliners a-la if(true) doSomething instead of if(true){doSomething}. This behavior makes jshint cry, while being presented all around the code. What about just disabling "curly"?
    2. 'strict mode' is presented only on some files. Moreover, there are var definitions before scoped function, for example - categories.js. Is there a reason for it? I would rather think about putting everything in the function's body to be simple and logical way, but mb I'm missing something?
  • Admin NodeBB

    The codebase isn't really 100% following the code style, which we should fix. We just couldn't get around to it yet.

    I prefer

     if(condition) {
     }
    

    Is that the server side categories.js or the client side?


  • Server, but I have seen more than few files with similar issues.

    Thanks for confirmation on styling!

  • Admin NodeBB

    I think you are referring to vars like

    https://github.com/designcreateplay/NodeBB/blob/master/src/categories.js#L47

    If that's the case you are right those can and probably should move into the functions where they are used.

Suggested Topics

  • 2
  • 3
  • 1
  • 3
  • 6
| |