We follow the Polymer guidelines as well as JSLint as best possible, but with some exceptions.
Most importantly, we skip the check for $ properties since Polymer populates this.$ and we also skip the check for _variable since that's the way Polymer wants to do private properties and methods. Finally we allow the use of this.
In addition to this we also choose to indent with tabs.
To lint the JavaScript, you will need to install node-jslint, download our jslint edition and save it as jslint-cosmoz.js in the node-jslint lib folder.
- Linux:
/usr/local/lib/node_modules/jslint/lib - Windows:
%APPDATA%\npm\node_modules\jslint\lib
The easiest way to conform to the guidelines is to run Sublime Text 3 and install the following packages:
- SublimeLinter
- SublimeLinter-contrib-jslint
- TrailingSpaces
- SublimeLinter:
"show_errors_on_save": true - TrailingSpaces:
"trailing_spaces_trim_on_save": true
Just follow the standard fork and pull request workflow.