Skip to content

JavaScript Guidelines

Ilias Trichopoulos edited this page Mar 10, 2017 · 3 revisions

Code style/basic mistakes

Use eslint (there are plugins for IDEs) with the provided .eslintrc.yml file (should be automatic).

Naming of stuff

  • Use evt for the DOM event parameter in handlers;
  • Use self instead of this if self is already defined in the current scope;
  • Use the prefix $ for variables containing jQuery objects (example: var $author = self.find('#author'))
Clone this wiki locally