Javascript styleguide - BlickLabs/generator-frontend-blick GitHub Wiki

Javascript styleguide

For general conventions, check the Google Style Guide.

As it has been mentioned before, this layout is not recomended for client-side apps based on MCV frameworks. This implies that most of the javascript code you need to write is only related to animations, validations and simple DOM manipulation. However, even simple code needs to be modularized so that it can be easily modified.

For this reason, you should have your js code separated into small files, each one related to a different plugin/task of the project. This layout includes 3 default js files: menu.js, validations.js and app.js

Additionally, all the code inside each file should be wrapped inside a self-invoking function. Make sure that your code is passing the linting process that is integrated in this layout via jshint.