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