docdis/learn-jshint

View on GitHub
.jshintrc-with-comments

Summary

Maintainability
Test Coverage
{
  "asi"           : true,   // Tolerate Automatic Semicolon Insertion (no semicolons).
  "laxbreak"      : true,   // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
  "bitwise"       : true,   // Prohibit bitwise operators (&, |, ^, etc.).
  "boss"          : false,  // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
  "curly"         : true,   // Require {} for every new block or scope.
  "eqeqeq"        : true,   // Require triple equals i.e. `===`.
  "eqnull"        : false,  // Tolerate use of `== null`.
  "evil"          : false,  // Tolerate use of `eval`.
  "expr"          : false,  // Tolerate `ExpressionStatement` as Programs.
  "forin"         : false,  // Tolerate `for in` loops without `hasOwnPrototype`.
  "immed"         : true,   // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
  "indent"        : 2,      // I prefer 4 spaces. but tired of fighting the indent wars...
  "latedef"       : true,   // Prohipit variable use before definition.
  "loopfunc"      : false,  // Allow functions to be defined within loops.
  "noarg"         : true,   // Prohibit use of `arguments.caller` and `arguments.callee`.
  "node"          : true,   // this file will be run by node.js so allow require() and exports() etc.
  "regexp"        : true,   // Prohibit `.` and `[^...]` in regular expressions.
  "regexdash"     : false,  // Tolerate unescaped last dash i.e. `[-...]`.
  "strict"        : false,  // Require `use strict` pragma  in every file.
  "scripturl"     : true,   // Tolerate script-targeted URLs.
  "shadow"        : false,  // Allows re-define variables later in code e.g. `var x=1; x=2;`.
  "supernew"      : false,  // Tolerate `new function () { ... };` and `new Object;`
  "sub"           : true,   // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
  "undef"         : true,   // Require all non-global variables be declared before they are used.
  "white"         : true,   // Check against strict whitespace and indentation rules.
  // for a full description of each of rule, please see: http://www.jshint.com/docs
  // If you have a valid reason to change any rules, please submit a pull request for discussion
}