.jshintrc 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {
  2. // --------------------------------------------------------------------
  3. // JSHint Configuration, Strict Edition
  4. // --------------------------------------------------------------------
  5. //
  6. // This is a options template for [JSHint][1], using [JSHint example][2]
  7. // and [Ory Band's example][3] as basis and setting config values to
  8. // be most strict:
  9. //
  10. // * set all enforcing options to true
  11. // * set all relaxing options to false
  12. // * set all environment options to false, except the browser value
  13. // * set all JSLint legacy options to false
  14. //
  15. // [1]: http://www.jshint.com/
  16. // [2]: https://github.com/jshint/node-jshint/blob/master/example/config.json
  17. // [3]: https://github.com/oryband/dotfiles/blob/master/jshintrc
  18. //
  19. // @author http://michael.haschke.biz/
  20. // @license http://unlicense.org/
  21. // == Enforcing Options ===============================================
  22. //
  23. // These options tell JSHint to be more strict towards your code. Use
  24. // them if you want to allow only a safe subset of JavaScript, very
  25. // useful when your codebase is shared with a big number of developers
  26. // with different skill levels.
  27. "bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
  28. "curly" : true, // Require {} for every new block or scope.
  29. "eqeqeq" : true, // Require triple equals i.e. `===`.
  30. "forin" : true, // Tolerate `for in` loops without `hasOwnPrototype`.
  31. "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
  32. "latedef" : true, // Prohibit variable use before definition.
  33. "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
  34. "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
  35. "noempty" : true, // Prohibit use of empty blocks.
  36. "nonew" : true, // Prohibit use of constructors for side-effects.
  37. "plusplus" : true, // Prohibit use of `++` & `--`.
  38. "regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
  39. "undef" : true, // Require all non-global variables be declared before they are used.
  40. "strict" : false, // Require `use strict` pragma in every file.
  41. "trailing" : true, // Prohibit trailing whitespaces.
  42. // == Relaxing Options ================================================
  43. //
  44. // These options allow you to suppress certain types of warnings. Use
  45. // them only if you are absolutely positive that you know what you are
  46. // doing.
  47. "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
  48. "boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
  49. "debug" : false, // Allow debugger statements e.g. browser breakpoints.
  50. "eqnull" : false, // Tolerate use of `== null`.
  51. "es5" : false, // Allow EcmaScript 5 syntax.
  52. "esnext" : false, // Allow ES.next specific features such as `const` and `let`.
  53. "evil" : false, // Tolerate use of `eval`.
  54. "expr" : false, // Tolerate `ExpressionStatement` as Programs.
  55. "funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside.
  56. "globalstrict" : false, // Allow global "use strict" (also enables 'strict').
  57. "iterator" : false, // Allow usage of __iterator__ property.
  58. "lastsemic" : false, // Tolerat missing semicolons when the it is omitted for the last statement in a one-line block.
  59. "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
  60. "laxcomma" : false, // Suppress warnings about comma-first coding style.
  61. "loopfunc" : false, // Allow functions to be defined within loops.
  62. "multistr" : false, // Tolerate multi-line strings.
  63. "onecase" : false, // Tolerate switches with just one case.
  64. "proto" : false, // Tolerate __proto__ property. This property is deprecated.
  65. "regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
  66. "scripturl" : false, // Tolerate script-targeted URLs.
  67. "smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only.
  68. "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
  69. "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
  70. "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
  71. "validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function.
  72. // == Environments ====================================================
  73. //
  74. // These options pre-define global variables that are exposed by
  75. // popular JavaScript libraries and runtime environments—such as
  76. // browser or node.js.
  77. "browser" : false, // Standard browser globals e.g. `window`, `document`.
  78. "couch" : false, // Enable globals exposed by CouchDB.
  79. "devel" : false, // Allow development statements e.g. `console.log();`.
  80. "dojo" : false, // Enable globals exposed by Dojo Toolkit.
  81. "jquery" : false, // Enable globals exposed by jQuery JavaScript library.
  82. "mootools" : false, // Enable globals exposed by MooTools JavaScript framework.
  83. "node" : true, // Enable globals available when code is running inside of the NodeJS runtime environment.
  84. "nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape.
  85. "prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework.
  86. "rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment.
  87. "wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host.
  88. // == JSLint Legacy ===================================================
  89. //
  90. // These options are legacy from JSLint. Aside from bug fixes they will
  91. // not be improved in any way and might be removed at any point.
  92. "nomen" : false, // Prohibit use of initial or trailing underbars in names.
  93. "onevar" : false, // Allow only one `var` statement per function.
  94. "passfail" : false, // Stop on first error.
  95. "white" : false, // Check against strict whitespace and indentation rules.
  96. // == Undocumented Options ============================================
  97. //
  98. // While I've found these options in [example1][2] and [example2][3]
  99. // they are not described in the [JSHint Options documentation][4].
  100. //
  101. // [4]: http://www.jshint.com/options/
  102. "maxerr" : 100, // Maximum errors before stopping.
  103. "predef" : [ // Extra globals.
  104. //"exampleVar",
  105. //"anotherCoolGlobal",
  106. //"iLoveDouglas"
  107. ],
  108. "indent" : 2, // Specify indentation spacing
  109. "maxlen" : 100 // The maximum number of characters in a line.
  110. }