.jshintrc 6.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {
  2. // JSHint Default Configuration File (as on JSHint website)
  3. // See http://jshint.com/docs/ for more details
  4. "maxerr" : 50, // {int} Maximum error before stopping
  5. // Enforcing
  6. "bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
  7. "camelcase" : false, // true: Identifiers must be in camelCase
  8. "curly" : true, // true: Require {} for every new block or scope
  9. "eqeqeq" : true, // true: Require triple equals (===) for comparison
  10. "forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
  11. "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
  12. "indent" : false, // {int} Number of spaces to use for indentation
  13. "latedef" : false, // true: Require variables/functions to be defined before being used
  14. "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
  15. "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
  16. "noempty" : true, // true: Prohibit use of empty blocks
  17. "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
  18. "plusplus" : false, // true: Prohibit use of `++` & `--`
  19. "quotmark" : false, // Quotation mark consistency:
  20. // false : do nothing (default)
  21. // true : ensure whatever is used is consistent
  22. // "single" : require single quotes
  23. // "double" : require double quotes
  24. "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
  25. "unused" : false, // true: Require all defined variables be used
  26. "strict" : true, // true: Requires all functions run in ES5 Strict Mode
  27. "trailing" : false, // true: Prohibit trailing whitespaces
  28. "maxparams" : false, // {int} Max number of formal params allowed per function
  29. "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
  30. "maxstatements" : false, // {int} Max number statements per function
  31. "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
  32. "maxlen" : false, // {int} Max number of characters per line
  33. // Relaxing
  34. "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
  35. "boss" : true, // true: Tolerate assignments where comparisons would be expected
  36. "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
  37. "eqnull" : false, // true: Tolerate use of `== null`
  38. "es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
  39. "esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`)
  40. "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
  41. // (ex: `for each`, multiple try/catch, function expression…)
  42. "evil" : false, // true: Tolerate use of `eval` and `new Function()`
  43. "expr" : true, // true: Tolerate `ExpressionStatement` as Programs
  44. "funcscope" : false, // true: Tolerate defining variables inside control statements"
  45. "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
  46. "iterator" : false, // true: Tolerate using the `__iterator__` property
  47. "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
  48. "laxbreak" : true, // true: Tolerate possibly unsafe line breakings
  49. "laxcomma" : false, // true: Tolerate comma-first style coding
  50. "loopfunc" : true, // true: Tolerate functions being defined in loops
  51. "multistr" : true, // true: Tolerate multi-line strings
  52. "proto" : false, // true: Tolerate using the `__proto__` property
  53. "scripturl" : false, // true: Tolerate script-targeted URLs
  54. "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
  55. "shadow" : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
  56. "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
  57. "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
  58. "validthis" : false, // true: Tolerate using this in a non-constructor function
  59. // Environments
  60. "browser" : true, // Web Browser (window, document, etc)
  61. "couch" : false, // CouchDB
  62. "devel" : true, // Development/debugging (alert, confirm, etc)
  63. "dojo" : false, // Dojo Toolkit
  64. "jquery" : false, // jQuery
  65. "mootools" : false, // MooTools
  66. "node" : true, // Node.js
  67. "nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
  68. "prototypejs" : false, // Prototype and Scriptaculous
  69. "rhino" : false, // Rhino
  70. "worker" : false, // Web Workers
  71. "wsh" : false, // Windows Scripting Host
  72. "yui" : false, // Yahoo User Interface
  73. "noyield" : true, // allow generators without a yield
  74. // Legacy
  75. "nomen" : false, // true: Prohibit dangling `_` in variables
  76. "onevar" : false, // true: Allow only one `var` statement per function
  77. "passfail" : false, // true: Stop on first error
  78. "white" : false, // true: Check against strict whitespace and indentation rules
  79. // Custom Globals
  80. "globals" : { // additional predefined global variables
  81. // mocha
  82. "describe": true,
  83. "it": true,
  84. "before": true,
  85. "afterEach": true,
  86. "beforeEach": true,
  87. "after": true
  88. }
  89. }