.jshintrc 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //.jshintrc
  2. {
  3. // JSHint Meteor Configuration File
  4. // Match the Meteor Style Guide
  5. //
  6. // By @raix with contributions from @aldeed and @awatson1978
  7. // Source https://github.com/raix/Meteor-jshintrc
  8. //
  9. // See http://jshint.com/docs/ for more details
  10. "maxerr" : 50, // {int} Maximum error before stopping
  11. // Enforcing
  12. "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
  13. "camelcase" : true, // true: Identifiers must be in camelCase
  14. "curly" : true, // true: Require {} for every new block or scope
  15. "eqeqeq" : true, // true: Require triple equals (===) for comparison
  16. "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
  17. "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
  18. "indent" : 2, // {int} Number of spaces to use for indentation
  19. "latedef" : false, // true: Require variables/functions to be defined before being used
  20. "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
  21. "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
  22. "noempty" : true, // true: Prohibit use of empty blocks
  23. "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
  24. "plusplus" : false, // true: Prohibit use of `++` & `--`
  25. "quotmark" : false, // Quotation mark consistency:
  26. // false : do nothing (default)
  27. // true : ensure whatever is used is consistent
  28. // "single" : require single quotes
  29. // "double" : require double quotes
  30. "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
  31. "unused" : true, // true: Require all defined variables be used
  32. "strict" : false, // true: Requires all functions run in ES5 Strict Mode
  33. "trailing" : true, // true: Prohibit trailing whitespaces
  34. "maxparams" : false, // {int} Max number of formal params allowed per function
  35. "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
  36. "maxstatements" : false, // {int} Max number statements per function
  37. "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
  38. "maxlen" : 80, // {int} Max number of characters per line
  39. // Relaxing
  40. "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
  41. "boss" : false, // true: Tolerate assignments where comparisons would be expected
  42. "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
  43. "eqnull" : false, // true: Tolerate use of `== null`
  44. "es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
  45. "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
  46. "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
  47. // (ex: `for each`, multiple try/catch, function expression…)
  48. "evil" : false, // true: Tolerate use of `eval` and `new Function()`
  49. "expr" : false, // true: Tolerate `ExpressionStatement` as Programs
  50. "funcscope" : false, // true: Tolerate defining variables inside control statements"
  51. "globalstrict" : true, // true: Allow global "use strict" (also enables 'strict')
  52. "iterator" : false, // true: Tolerate using the `__iterator__` property
  53. "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
  54. "laxbreak" : false, // true: Tolerate possibly unsafe line breakings
  55. "laxcomma" : false, // true: Tolerate comma-first style coding
  56. "loopfunc" : false, // true: Tolerate functions being defined in loops
  57. "multistr" : false, // true: Tolerate multi-line strings
  58. "proto" : false, // true: Tolerate using the `__proto__` property
  59. "scripturl" : false, // true: Tolerate script-targeted URLs
  60. "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
  61. "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
  62. "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
  63. "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
  64. "validthis" : false, // true: Tolerate using this in a non-constructor function
  65. // Environments
  66. "browser" : true, // Web Browser (window, document, etc)
  67. "couch" : false, // CouchDB
  68. "devel" : true, // Development/debugging (alert, confirm, etc)
  69. "dojo" : false, // Dojo Toolkit
  70. "jquery" : false, // jQuery
  71. "mootools" : false, // MooTools
  72. "node" : false, // Node.js
  73. "nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
  74. "prototypejs" : false, // Prototype and Scriptaculous
  75. "rhino" : false, // Rhino
  76. "worker" : false, // Web Workers
  77. "wsh" : false, // Windows Scripting Host
  78. "yui" : false, // Yahoo User Interface
  79. //"meteor" : false, // Meteor.js
  80. // Legacy
  81. "nomen" : false, // true: Prohibit dangling `_` in variables
  82. "onevar" : false, // true: Allow only one `var` statement per function
  83. "passfail" : false, // true: Stop on first error
  84. "white" : false, // true: Check against strict whitespace and indentation rules
  85. // Custom globals, from http://docs.meteor.com, in the order they appear there
  86. "globals" : {
  87. "Meteor": false,
  88. "DDP": false,
  89. "Mongo": false, //Meteor.Collection renamed to Mongo.Collection
  90. "Session": false,
  91. "Accounts": false,
  92. "Template": false,
  93. "Blaze": false, //UI is being renamed Blaze
  94. "UI": false,
  95. "Match": false,
  96. "check": false,
  97. "Tracker": false, //Deps renamed to Tracker
  98. "Deps": false,
  99. "ReactiveVar": false,
  100. "EJSON": false,
  101. "HTTP": false,
  102. "Email": false,
  103. "Assets": false,
  104. "Handlebars": false, // https://github.com/meteor/meteor/wiki/Handlebars
  105. "Package": false,
  106. "App": false, //mobile-config.js
  107. // Meteor internals
  108. "DDPServer": false,
  109. "global": false,
  110. "Log": false,
  111. "MongoInternals": false,
  112. "process": false,
  113. "WebApp": false,
  114. "WebAppInternals": false,
  115. // globals useful when creating Meteor packages
  116. "Npm": false,
  117. "Tinytest": false,
  118. // common Meteor packages
  119. "Random": false,
  120. "_": false, // Underscore.js
  121. "$": false, // jQuery
  122. "Router": false, // iron-router
  123. // Microscope globals
  124. // - Collections
  125. "Errors": true,
  126. "Mongo": true,
  127. "Posts": true,
  128. // - Helpers
  129. "ownsDocument": true,
  130. "throwError": true,
  131. "validatePost": true,
  132. // - Fictive global just for the last comma
  133. "xyzzy": false
  134. }
  135. }