forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jshintrc
146 lines (133 loc) · 10.1 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
142
143
144
145
146
// --------------------------------------------------------------------
// JSHint Configuration
// --------------------------------------------------------------------
//
// http://www.jshint.com/
// http://jshint.com/docs/options/
{
// == Enforcing Options ===============================================
"bitwise" : false, // Prohibits the use of bitwise operators such as ^ (XOR), | (OR) and others. Bitwise operators are very rare in JavaScript programs and quite often & is simply a mistyped &&.
"camelcase" : false, // Allows you to force all variable names to use either camelCase style or UPPER_CASE with underscores.
"curly" : true, // Requires you to always put curly braces around blocks in loops and conditionals. JavaScript allows you to omit curly braces when the block consists of only one statement
"eqeqeq" : true, // Prohibits the use of == and != in favor of === and !==.
"es3" : false, // Tells JSHint that your code needs to adhere to ECMAScript 3 specification. Use this option if you need your program to be executable in older browsers—such as Internet Explorer 6/7/8/9.
"forin" : true, // Requires all for in loops to filter object's items.
"freeze" : true, // Prohibits overwriting prototypes of native objects such as Array, Date and so on.
"immed" : true, // Prohibits the use of immediate function invocations without wrapping them in parentheses.
// "indent" : 4, // Enforces specific tab width for your code. Has no effect when "white" option is not used.
"latedef" : "nofunc", // Prohibits the use of a variable before it was defined. Setting this option to "nofunc" will allow function declarations to be ignored.
"newcap" : true, // Requires you to capitalize names of constructor functions.
"noarg" : true, // Prohibits the use of arguments.caller and arguments.callee.
"noempty" : true, // Warns when you have an empty block in your code.
"nonbsp" : true, // Warns about "non-breaking whitespace" characters.
"nonew" : true, // Prohibits the use of constructor functions for side-effects.
"plusplus" : false, // Prohibits the use of unary increment and decrement operators.
"quotmark" : false, // Enforces the consistency of quotation marks used throughout your code. It accepts three values: true, "single", and "double".
"undef" : true, // Prohibits the use of explicitly undeclared variables.
"unused" : true, // Warns when you define and never use your variables.
"strict" : true, // Requires all functions to run in ECMAScript 5's strict mode.
"trailing" : true, // Makes it an error to leave a trailing whitespace in your code.
"maxlen" : 120, // Lets you set the maximum length of a line.
//"maxparams" : 4, // Lets you set the max number of formal parameters allowed per function.
//"maxdepth" : 4, // Lets you control how nested do you want your blocks to be.
//"maxstatements" : 4, // Lets you set the max number of statements allowed per function.
//"maxcomplexity" : 4, // Lets you control cyclomatic complexity throughout your code.
// == Relaxing Options ================================================
"asi" : false, // Suppresses warnings about missing semicolons.
"boss" : false, // Suppresses warnings about the use of assignments in cases where comparisons are expected.
"debug" : false, // Suppresses warnings about the debugger statements in your code.
"eqnull" : false, // Suppresses warnings about == null comparisons.
"esnext" : false, // Tells JSHint that your code uses ECMAScript 6 specific syntax.
"evil" : false, // Suppresses warnings about the use of eval.
"expr" : false, // Suppresses warnings about the use of expressions where normally you would expect to see assignments or function calls.
"funcscope" : false, // Suppresses warnings about declaring variables inside of control structures while accessing them later from the outside.
"gcl" : false, // Makes JSHint compatible with Google Closure Compiler.
"globalstrict" : false, // Suppresses warnings about the use of global strict mode.
"iterator" : false, // Suppresses warnings about the __iterator__ property.
"lastsemic" : false, // Suppresses warnings about missing semicolons, but only when the semicolon is omitted for the last statement in a one-line block.
"laxbreak" : false, // Suppresses most of the warnings about possibly unsafe line breaks in your code.
"laxcomma" : false, // Suppresses warnings about comma-first coding style.
"loopfunc" : false, // Suppresses warnings about functions inside of loops.
"maxerr" : 100, // Set the maximum amount of warnings JSHint will produce before giving up.
"moz" : false, // Tells JSHint that your code uses Mozilla JavaScript extensions.
"notypeof" : false, // Suppresses warnings about invalid typeof operator values.
"proto" : false, // Suppresses warnings about the __proto__ property.
"scripturl" : false, // Suppresses warnings about the use of script-targeted URLs—such as javascript:...
"smarttabs" : false, // Suppresses warnings about mixed tabs and spaces when the latter are used for alignment only.
"shadow" : false, // Suppresses warnings about variable shadowing i.e. declaring a variable that had been already declared somewhere in the outer scope.
"sub" : false, // Suppresses warnings about using [] notation when it can be expressed in dot notation.
"supernew" : false, // Suppresses warnings about "weird" constructions like new function () { ... } and new Object;.
"validthis" : true, // Suppresses warnings about possible strict violations when the code is running in strict mode and you use this in a non-constructor function.
"noyield" : false, // Suppresses warnings about generator functions with no yield statement in them.
// == Environments ====================================================
//
// These options pre-define global variables that are exposed by
// popular JavaScript libraries and runtime environments—such as
// browser or node.js.
"browser" : true, // Defines globals exposed by modern browsers: all the way from good old document and navigator to the HTML5 FileReader and other new developments in the browser world.
"devel" : true, // Defines globals that are usually used for logging poor-man's debugging: console, alert, etc.
// The rest should remain `false`. Please see explanation for the "predef" parameter below.
"couch" : false, // Defines globals exposed by CouchDB.
"dojo" : false, // Defines globals exposed by the Dojo Toolkit
"jquery" : false, // Defines globals exposed by the jQuery JavaScript library.
"mootools" : false, // Defines globals exposed by the MooTools JavaScript framework.
"node" : false, // Defines globals available when your code is running inside of the Node runtime environment.
"nonstandard" : false, // Defines non-standard but widely adopted globals such as escape and unescape.
"phantom" : false, // Defines globals available when your core is running inside of the PhantomJS runtime environment.
"prototypejs" : false, // Defines globals exposed by the Prototype JavaScript framework.
"rhino" : false, // Defines globals available when your code is running inside of the Rhino runtime environment.
"worker" : false, // Defines globals available when your code is running inside of a Web Worker.
"wsh" : false, // Defines globals available when your code is running as a script for the Windows Script Host.
"yui" : false, // Defines globals exposed by the YUI JavaScript framework.
// == JSLint Legacy ===================================================
//
// These options are legacy from JSLint. Aside from bug fixes they will
// not be improved in any way and might be removed at any point.
// "nomen" : false, // Disallows the use of dangling _ in variables.
// "onevar" : false, // Allows only one var statement per function.
// "passfail" : false, // Makes JSHint stop on the first error or warning.
// "white" : false, // make JSHint check your source code against Douglas Crockford's JavaScript coding style.
// == Undocumented Options ============================================
//
// If you are using some global variable, for example `define`, or `$`, please
// make it available within your JS file by passing it to the wrapper anonymous
// function like so:
//
// (function (define, $) {
// 'use strict';
// // Your content goes here which uses `define`, and `$`.
// }).call(this, window.define, window.jQuery);
//
// The parameter "predef" should remain empty for this configuration file
// to remain as general as possible.
"predef": [
// jQuery globals
"jQuery", "$",
// Underscore.js globals
"_",
// RequireJS globals
"define",
"require",
"RequireJS",
// Jasmine globals
"jasmine",
"describe", "xdescribe",
"it", "xit",
"spyOn",
"beforeEach",
"afterEach",
"expect",
"waitsFor",
"runs",
// jQuery-Jasmine globals
"loadFixtures",
"appendLoadFixtures",
"readFixtures",
"setFixtures",
"appendSetFixtures",
"spyOnEvent",
// Miscellaneous globals
"JSON",
"gettext"
]
}