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