|
| 1 | +{ |
| 2 | + // -------------------------------------------------------------------- |
| 3 | + // JSHint Configuration |
| 4 | + // -------------------------------------------------------------------- |
| 5 | + // |
| 6 | + // @author Chad Engler <chad@pantherdev.com> |
| 7 | + |
| 8 | + // == Enforcing Options =============================================== |
| 9 | + // |
| 10 | + // These options tell JSHint to be more strict towards your code. Use |
| 11 | + // them if you want to allow only a safe subset of JavaScript, very |
| 12 | + // useful when your codebase is shared with a big number of developers |
| 13 | + // with different skill levels. |
| 14 | + |
| 15 | + "bitwise" : false, // Disallow bitwise operators (&, |, ^, etc.). |
| 16 | + "camelcase" : true, // Force all variable names to use either camelCase or UPPER_CASE. |
| 17 | + "curly" : false, // Require {} for every new block or scope. |
| 18 | + "eqeqeq" : true, // Require triple equals i.e. `===`. |
| 19 | + "es3" : false, // Enforce conforming to ECMAScript 3. |
| 20 | + "forin" : false, // Disallow `for in` loops without `hasOwnPrototype`. |
| 21 | + "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` |
| 22 | + "indent" : 4, // Require that 4 spaces are used for indentation. |
| 23 | + "latedef" : true, // Prohibit variable use before definition. |
| 24 | + "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. |
| 25 | + "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. |
| 26 | + "noempty" : true, // Prohibit use of empty blocks. |
| 27 | + "nonew" : true, // Prohibit use of constructors for side-effects. |
| 28 | + "plusplus" : false, // Disallow use of `++` & `--`. |
| 29 | + "quotmark" : true, // Force consistency when using quote marks. |
| 30 | + "undef" : true, // Require all non-global variables be declared before they are used. |
| 31 | + "unused" : true, // Warn when varaibles are created by not used. |
| 32 | + "strict" : false, // Require `use strict` pragma in every file. |
| 33 | + "trailing" : true, // Prohibit trailing whitespaces. |
| 34 | + "maxparams" : 8, // Prohibit having more than X number of params in a function. |
| 35 | + "maxdepth" : 8, // Prohibit nested blocks from going more than X levels deep. |
| 36 | + "maxstatements" : false, // Restrict the number of statements in a function. |
| 37 | + "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. |
| 38 | + "maxlen" : 220, // Require that all lines are 100 characters or less. |
| 39 | + "globals" : { // Register globals that are used in the code. |
| 40 | + //commonjs globals |
| 41 | + "module": false, |
| 42 | + "require": false, |
| 43 | + |
| 44 | + // PIXI globals |
| 45 | + "PIXI": false, |
| 46 | + "spine": false, |
| 47 | + |
| 48 | + //chai globals |
| 49 | + "chai": false, |
| 50 | + |
| 51 | + //mocha globals |
| 52 | + "describe": false, |
| 53 | + "it": false, |
| 54 | + |
| 55 | + //resemble globals |
| 56 | + "resemble": false |
| 57 | + }, |
| 58 | + |
| 59 | + // == Relaxing Options ================================================ |
| 60 | + // |
| 61 | + // These options allow you to suppress certain types of warnings. Use |
| 62 | + // them only if you are absolutely positive that you know what you are |
| 63 | + // doing. |
| 64 | + |
| 65 | + "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). |
| 66 | + "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. |
| 67 | + "debug" : false, // Allow debugger statements e.g. browser breakpoints. |
| 68 | + "eqnull" : false, // Tolerate use of `== null`. |
| 69 | + "esnext" : false, // Allow ES.next specific features such as `const` and `let`. |
| 70 | + "evil" : false, // Tolerate use of `eval`. |
| 71 | + "expr" : false, // Tolerate `ExpressionStatement` as Programs. |
| 72 | + "funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside. |
| 73 | + "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). |
| 74 | + "iterator" : false, // Allow usage of __iterator__ property. |
| 75 | + "lastsemic" : false, // Tolerate missing semicolons when the it is omitted for the last statement in a one-line block. |
| 76 | + "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. |
| 77 | + "laxcomma" : false, // Suppress warnings about comma-first coding style. |
| 78 | + "loopfunc" : false, // Allow functions to be defined within loops. |
| 79 | + "moz" : false, // Code that uses Mozilla JS extensions will set this to true |
| 80 | + "multistr" : false, // Tolerate multi-line strings. |
| 81 | + "proto" : false, // Tolerate __proto__ property. This property is deprecated. |
| 82 | + "scripturl" : false, // Tolerate script-targeted URLs. |
| 83 | + "smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only. |
| 84 | + "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. |
| 85 | + "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. |
| 86 | + "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. |
| 87 | + "validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function. |
| 88 | + |
| 89 | + // == Environments ==================================================== |
| 90 | + // |
| 91 | + // These options pre-define global variables that are exposed by |
| 92 | + // popular JavaScript libraries and runtime environments—such as |
| 93 | + // browser or node.js. |
| 94 | + |
| 95 | + "browser" : true, // Standard browser globals e.g. `window`, `document`. |
| 96 | + "couch" : false, // Enable globals exposed by CouchDB. |
| 97 | + "devel" : false, // Allow development statements e.g. `console.log();`. |
| 98 | + "dojo" : false, // Enable globals exposed by Dojo Toolkit. |
| 99 | + "jquery" : false, // Enable globals exposed by jQuery JavaScript library. |
| 100 | + "mootools" : false, // Enable globals exposed by MooTools JavaScript framework. |
| 101 | + "node" : false, // Enable globals available when code is running inside of the NodeJS runtime environment. (for Gruntfile) |
| 102 | + "nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape. |
| 103 | + "prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework. |
| 104 | + "rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment. |
| 105 | + "worker" : false, // Enable globals available when your code is running as a WebWorker. |
| 106 | + "wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host. |
| 107 | + "yui" : false, // Enable globals exposed by YUI library. |
| 108 | + |
| 109 | + // == JSLint Legacy =================================================== |
| 110 | + // |
| 111 | + // These options are legacy from JSLint. Aside from bug fixes they will |
| 112 | + // not be improved in any way and might be removed at any point. |
| 113 | + |
| 114 | + "nomen" : false, // Prohibit use of initial or trailing underbars in names. |
| 115 | + "onevar" : false, // Allow only one `var` statement per function. |
| 116 | + "passfail" : false, // Stop on first error. |
| 117 | + "white" : false, // Check against strict whitespace and indentation rules. |
| 118 | + |
| 119 | + // == Undocumented Options ============================================ |
| 120 | + // |
| 121 | + // While I've found these options in some projects, they are not |
| 122 | + // described in the [JSHint Options documentation][4]. |
| 123 | + // |
| 124 | + // [4]: http://www.jshint.com/options/ |
| 125 | + |
| 126 | + "maxerr" : 100 // Maximum errors before stopping. |
| 127 | +} |
0 commit comments