[Screeninvader] Javascript code convention

pl c at c0mm.it
Fri Apr 10 13:38:00 CEST 2015


Is his guide complete? Are there already linters filled with his schematics?

What I've read in the past is airbnb's JavaScript Style Guide [0], they are also providing linter configurations and their approach with bad / good examples are easy to follow.
Since I haven't had much to do with the js code yet - but: The current approach with declaring variables looks weird for me (an indented semicolon after multiple variable declerations). Airbnb's guide suggests (like google too[1]) to use only single var declarations. Idiomatic.js is different there [2], though I think airbnb's reasoning is more correct.
I think the main problem jaeh had, was that he was not using a code linter and created his styling around being able to reduce nitpicks, which, in my opinion, don't happen if you are using a correctly configured editor including a linter (sorry jaeh).

We should setup stuff like jscs [3] for enforcing code styles before you can send pull requests.

[0]: https://github.com/airbnb/javascript
[1]: https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
[2]: https://github.com/rwaldron/idiomatic.js
[3]: http://jscs.info/



More information about the Screeninvader mailing list