1 | //
|
2 | // http://www.jshint.com/docs/options/
|
3 | //
|
4 | module.exports = {
|
5 | /**
|
6 | * Enforcing options
|
7 | * When set to true, these options will make JSHint produce more warnings about your code.
|
8 | */
|
9 |
|
10 | // This option prohibits the use of bitwise operators such as ^ (XOR), | (OR) and others.
|
11 | // Bitwise operators are very rare in JavaScript programs and quite often & is simply a mistyped &&.
|
12 | bitwise: false,
|
13 | // This option allows you to force all variable names to use either camelCase style or UPPER_CASE with underscores.
|
14 | camelcase: false,
|
15 | // This option requires you to always put curly braces around blocks in loops and conditionals.
|
16 | curly: true,
|
17 | // This options prohibits the use of == and != in favor of === and !==.
|
18 | eqeqeq: true,
|
19 | // This option tells JSHint that your code needs to adhere to ECMAScript 3 specification.
|
20 | es3: true,
|
21 | // This option requires all for in loops to filter object's items.
|
22 | forin: false,
|
23 | // This option prohibits the use of immediate function invocations without wrapping them in parentheses.
|
24 | immed: true,
|
25 | // This option enforces specific tab width for your code. For example, the following code will trigger a warning on line 4:
|
26 | indent: 4,
|
27 | // This option prohibits the use of a variable before it was defined.
|
28 | latedef: true,
|
29 | // This option requires you to capitalize names of constructor functions.
|
30 | newcap: true,
|
31 | // This option prohibits the use of arguments.caller and arguments.callee.
|
32 | noarg: true,
|
33 | // This option warns when you have an empty block in your code.
|
34 | noempty: false,
|
35 | // This option prohibits the use of constructor functions for side-effects.
|
36 | nonew: true,
|
37 | // This option prohibits the use of unary increment and decrement operators.
|
38 | plusplus: false,
|
39 | // This option enforces the consistency of quotation marks used throughout your code.
|
40 | quotmark: true,
|
41 | // This option prohibits the use of explicitly undeclared variables.
|
42 | undef: true,
|
43 | // This option warns when you define and never use your variables.
|
44 | unused: false,
|
45 | // This option requires all functions to run in ECMAScript 5's strict mode.
|
46 | strict: false,
|
47 | // This option makes it an error to leave a trailing whitespace in your code.
|
48 | trailing: false,
|
49 |
|
50 | /**
|
51 | * Relaxing options
|
52 | * When set to true, these options will make JSHint produce less warnings about your code.
|
53 | */
|
54 |
|
55 | // This option suppresses warnings about missing semicolons.
|
56 | asi: false,
|
57 | // This option suppresses warnings about the use of assignments in cases where comparisons are expected.
|
58 | boss: false,
|
59 | // This option suppresses warnings about the debugger statements in your code.
|
60 | debug: false,
|
61 | // This option suppresses warnings about == null comparisons.
|
62 | eqnull: false,
|
63 | // This option tells JSHint that your code uses ECMAScript 6 specific syntax.
|
64 | esnext: false,
|
65 | // This option suppresses warnings about the use of eval.
|
66 | evil: false,
|
67 | // This option suppresses warnings about the use of expressions where normally you would expect to see assignments or function calls.
|
68 | expr: false,
|
69 | // This option suppresses warnings about declaring variables inside of control structures while accessing them later from the outside.
|
70 | funcscope: false,
|
71 | // This option suppresses warnings about the use of global strict mode.
|
72 | globalstrict: false,
|
73 | // This option suppresses warnings about the __iterator__ property.
|
74 | iterator: false,
|
75 | // This option suppresses warnings about missing semicolons, but only when the semicolon is omitted for the last statement in a one-line block.
|
76 | lastsemic: false,
|
77 | // This option suppresses most of the warnings about possibly unsafe line breakings in your code.
|
78 | laxbreak: false,
|
79 | // This option suppresses warnings about comma-first coding style.
|
80 | laxcomma: false,
|
81 | // This option suppresses warnings about functions inside of loops.
|
82 | loopfunc: false,
|
83 | // This options tells JSHint that your code uses Mozilla JavaScript extensions.
|
84 | moz: false,
|
85 | // This option suppresses warnings about multi-line strings.
|
86 | multistr: false,
|
87 | // This option suppresses warnings about the __proto__ property.
|
88 | proto: false,
|
89 | // This option suppresses warnings about the use of script-targeted URLs—such as javascript:....
|
90 | scripturl: false,
|
91 | // This option suppresses warnings about mixed tabs and spaces when the latter are used for alignmnent only.
|
92 | smarttabs: false,
|
93 | // This option suppresses warnings about variable shadowing i.e. declaring a variable that had been already declared somewhere in the outer scope.
|
94 | shadow: false,
|
95 | // This option suppresses warnings about using [] notation when it can be expressed in dot notation
|
96 | sub: true,
|
97 | // This option suppresses warnings about "weird" constructions like new function () { ... } and new Object;.
|
98 | supernew: false,
|
99 | // This option suppresses warnings about possible strict violations when the code is running in strict mode and you use this in a non-constructor function.
|
100 | validthis: false,
|
101 |
|
102 |
|
103 | /**
|
104 | * Environments
|
105 | * These options let JSHint know about some pre-defined global variables.
|
106 | */
|
107 | // This option defines globals exposed by modern browsers.
|
108 | browser: true,
|
109 |
|
110 | globals: {
|
111 | __dirname: true,
|
112 | process: true,
|
113 | exports: true,
|
114 | module: true,
|
115 | console: true,
|
116 | define: true,
|
117 | require: true,
|
118 | requirejs: true,
|
119 | Buffer: true,
|
120 | JSON: true
|
121 | }
|
122 | };
|