Skip to content
Guillaume edited this page Oct 4, 2017 · 3 revisions

Mapael uses JSHint to help maintain a proper code and catch early some small bugs.

Rules are found in .jshintrc file.

Rules justification

More explanation on options can be found here: http://jshint.com/docs/options

Environment

  • esversion: 3 Legacy ECMAScript version (IE9 and below)
  • jquery: true use jQuery
  • browser: true use browser env

Code quality

  • devel: true allow console

  • undef: true prohibits the use of explicitly undeclared variables

  • unused: true Warns about declared variable not used

  • nonbsp: true Warns about non-breaking whitespace characters

  • latedef: true Require variables/functions to be defined before being used

  • noarg: true Prohibit use of arguments.caller and arguments.callee

  • eqeqeq: true enforce strict equality (=== and !==)

  • forin: true requires all for in loops to filter object's items

  • freeze : true prohibits overwriting prototypes of native objects

  • nocomma : true prohibits the use of the comma operator

  • nonew : true prohibits the use of constructor functions for side-effects

Globals defined (to avoid undefined error message)

  • define: true for AMD
  • require: true for CommonJS
  • module: true for CommonJS
  • exports: true for CommonJS
  • Raphael: true for Raphael.js
Clone this wiki locally