-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jshintrc
141 lines (126 loc) · 6.59 KB
/
.jshintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{
// Configuration for JSHint. These settings are used to ensure code quality during the build process.
// Maximum number of rule violations to report before giving up.
"maxerr" : 100,
// List of variables to assume are already defined. Set to `true` to tolerate assigments to those variables.
"globals": {
// sitecues specific
"sitecues" : false,
"sitecuesEverywhere" : false,
"SC_DEV" : false,
"SC_LOCAL" : false,
"SC_VERSION" : false,
"console": false,
// AMD
"require" : false,
"define" : false,
// TODO: We should not be using escape(), it is non-standard and deprecated.
"escape": false,
// TODO: Submit patch to JSHint to include these in `browser` vars:
"webkitAudioContext" : false,
"CSSPrimitiveValue" : false,
"CSSStyleDeclaration" : false,
"devicePixelRatio" : false,
"pageXOffset" : false,
"pageYOffset" : false,
"innerWidth" : false,
"innerHeight" : false,
"outerWidth" : false,
"outerHeight" : false,
"screenX" : false,
"screenY" : false
},
// Enforcing - Rules that cause the linter to complain more.
// Whether to prohibit bitwise operators (&, |, ^, etc.), which are frequently typos.
"bitwise" : true,
// Whether to demand {} for every new block or scope, because explicit is good.
"curly" : true,
// Whether to demand triple equals (===) and disallow double equals, because type coercion is not user friendly.
"eqeqeq" : true,
// Whether to demand filtering for..in loops with obj.hasOwnProperty() to avoid the prototype chain.
"forin" : true,
// Whether to prohibit modifying the prototype of native objects.
"freeze" : true,
// Whether to demand that variables are defined above where they are first used.
"latedef" : "nofunc",
// Maximum cyclomatic complexity per function. Helps discourage overly complex code.
"maxcomplexity" : 15,
// Maximum depth of nested blocks (within functions). Helps discourage overly complex code.
"maxdepth" : 7,
// Maximum number of formal params allowed per function. Helps discourage overly complex code.
"maxparams" : 13,
// Maximum number of statements allowed per function. Helps discourage overly complex code.
"maxstatements" : 125,
// Whether to prohibit use of `arguments.caller` and `arguments.callee`, which is not in modern JS anymore.
"noarg" : true,
// Whether to prohibit use of non-breaking spaces within code, which can break pages with certain character encodings.
"nonbsp" : true,
// Whether to prohibit use of constructors for side-effects (without assignment).
"nonew" : true,
// Whether to prohibit use of `++` & `--`, which are usually not well understood outside of basic loops.
"plusplus" : false,
// Whether to prohibit use of `()` grouping where it is not necessary, which can obfuscate when it is really needed.
"singleGroups" : false,
// Whether to demand that all functions are run in ES5 Strict Mode
"strict" : false,
// Whether to prohibit usage of variables that are never defined.
"undef" : true,
// Whether to demand that all variables that are defined do eventually get used.
"unused" : true,
// Relaxing - Rules that cause the linter to chill out and complain less.
// Whether to tolerate Automatic Semicolon Insertion (no semicolons), even though the rules are hard to remember.
"asi" : false,
// Whether to tolerate assignments where comparisons would be expected.
"boss" : false,
// Whether to tolerate debugger statements e.g. browser breakpoints, even though they are not fit for production.
"debug" : false,
// Whether to tolerate use of `== null`, even though it does type coercion.
"eqnull" : false,
// Whether to tolerate use of ES6 syntax, like `const`, event though old browsers don't support it.
"esnext" : true,
// Whether to tolerate use of `eval` and `new Function()`, even though they can lead to security problems.
"evil" : false,
// Whether to tolerate seemingly useless expressions, even though they are usually typos.
"expr" : false,
// Whether to tolerate defining variables (with `var`) inside of blocks, even though that is not their scope.
"funcscope" : false,
// Whether to tolerate global use strict (also enables strict), even though nested code might not conform.
"globalstrict" : false,
// Whether to tolerate use of the `__iterator__` property.
"iterator" : false,
// Whether to tolerate omitting a semicolon for the last statement of a one-line block.
"lastsemic" : false,
// Whether to tolerate functions being defined in loops, even though it usually doesn't behave as first expected.
"loopfunc" : false,
// Whether to tolerate Mozilla specific syntax (extends and overrides esnext features)
"moz" : false,
// Whether to tolerate use of invalid return values from the `typeof` operator.
"notypeof" : false,
// Whether to tolerate using the `__proto__` property, even though it is non-standard and may hurt performance.
"proto" : false,
// Whether to tolerate script-targeted URLs.
"scripturl" : false,
// Whether to tolerate re-defining variables, which is often a mistake. e.g. `var x=1; x=2;`
// TODO: MAYBE: "shadow" : "outer" to cause more complaints?
"shadow" : false,
// Whether to tolerate `new function () { ... };` and `new Object;`, even though it probably doesn't do what you want.
"supernew" : false,
// Whether to tolerate using `this` in a non-constructor function, where it typically points to the global object.
"validthis" : false,
// Whether to tolerate use of the `with` statement, even though it causes potentially confusing behavior.
"withstmt" : false,
// Environments
"browser" : true, // Web Browser (window, document, etc)
"couch" : false, // CouchDB
"devel" : false, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jquery" : false, // jQuery
"mootools" : false, // MooTools
"node" : true, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"rhino" : false, // Rhino
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false // Yahoo User Interface
}