.jshintrc 5.2 KB

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