1 | {
|
2 | // Settings
|
3 | "passfail" : false, // Stop on first error.
|
4 | "maxerr" : 20, // Maximum error before stopping.
|
5 |
|
6 |
|
7 | // Predefined globals whom JSHint will ignore.
|
8 | "browser" : true, // Standard browser globals e.g. `window`, `document`.
|
9 |
|
10 | "node" : true,
|
11 | "rhino" : false,
|
12 | "couch" : false,
|
13 | "wsh" : false, // Windows Scripting Host.
|
14 |
|
15 | "jquery" : false,
|
16 | "prototypejs" : false,
|
17 | "mootools" : false,
|
18 | "dojo" : false,
|
19 |
|
20 | "predef" : [ // Custom globals.
|
21 | "define"
|
22 | ],
|
23 |
|
24 |
|
25 | // Development.
|
26 | "debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
27 | "devel" : true, // Allow developments statements e.g. `console.log();`.
|
28 |
|
29 |
|
30 | // ECMAScript 5.
|
31 | "es5" : false, // Allow ECMAScript 5 syntax.
|
32 | "strict" : false, // Require `use strict` pragma in every file.
|
33 | "globalstrict" : false, // Allow global "use strict" (also enables 'strict').
|
34 |
|
35 |
|
36 | // The Good Parts.
|
37 | "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
38 | "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
39 | "bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
|
40 | "boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
41 | "curly" : true, // Require {} for every new block or scope.
|
42 | "eqeqeq" : true, // Require triple equals i.e. `===`.
|
43 | "eqnull" : false, // Tolerate use of `== null`.
|
44 | "evil" : false, // Tolerate use of `eval`.
|
45 | "expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
46 | "forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
|
47 | "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
48 | "latedef" : true, // Prohibit variable use before definition.
|
49 | "loopfunc" : false, // Allow functions to be defined within loops.
|
50 | "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
51 | "nonstandard" : false, // Defines non-standard but widely adopted globals such as escape and unescape.
|
52 | "regexp" : false, // Prohibit `.` and `[^...]` in regular expressions.
|
53 | "regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
|
54 | "scripturl" : true, // Tolerate script-targeted URLs.
|
55 | "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
56 | "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
57 | "undef" : true, // Require all non-global variables be declared before they are used.
|
58 |
|
59 |
|
60 | // Personal styling preferences.
|
61 | "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
62 | "noempty" : false, // Prohibit use of empty blocks.
|
63 | "nonew" : true, // Prohibit use of constructors for side-effects.
|
64 | "nomen" : false, // Prohibit use of initial or trailing underbars in names.
|
65 | "onevar" : true, // Allow only one `var` statement per function.
|
66 | "plusplus" : true, // Prohibit use of `++` & `--`.
|
67 | "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
68 | "trailing" : true, // Prohibit trailing whitespaces.
|
69 | "white" : true, // Check against strict whitespace and indentation rules.
|
70 | "indent" : 4, // Specify indentation spacing
|
71 | "smarttabs" : true // Suppresses warnings about mixed tabs and spaces when the latter are used for alignmnent only
|
72 | }
|