-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.jscsrc
385 lines (370 loc) · 14.4 KB
/
.jscsrc
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
// current version - https://github.com/jshint/jshint/blob/5c96bf8fb89b747aceb8d10626153ad2fc4e5f36/examples/.jshintrc
"maxerr": 50,
// {int} Maximum error before stopping
// Enforcing
"bitwise": true,
// true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase": false,
// true: Identifiers must be in camelCase
"curly": true,
// true: Require {} for every new block or scope
"eqeqeq": true,
// true: Require triple equals (===) for comparison
"forin": true,
// true: Require filtering for..in loops with obj.hasOwnProperty()
"freeze": true,
// true: prohibits overwriting prototypes of native objects such as Array, Date etc.
"immed": false,
// true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"indent": 4,
// {int} Number of spaces to use for indentation
"latedef": false,
// true: Require variables/functions to be defined before being used
"newcap": false,
// true: Require capitalization of all constructor functions e.g. `new F()`
"noarg": true,
// true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty": true,
// true: Prohibit use of empty blocks
"nonbsp": true,
// true: Prohibit "non-breaking whitespace" characters.
"nonew": false,
// true: Prohibit use of constructors for side-effects (without assignment)
"plusplus": false,
// true: Prohibit use of `++` and `--`
"quotmark": false,
// Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef": true,
// true: Require all non-global variables to be declared (prevents global leaks)
"unused": true,
// Unused variables:
// true : all variables, last function parameter
// "vars" : all variables only
// "strict" : all variables, all function parameters
"strict": true,
// true: Requires all functions run in ES5 Strict Mode
"maxparams": false,
// {int} Max number of formal params allowed per function
"maxdepth": false,
// {int} Max depth of nested blocks (within functions)
"maxstatements": false,
// {int} Max number statements per function
"maxcomplexity": false,
// {int} Max cyclomatic complexity per function
"maxlen": false,
// {int} Max number of characters per line
"varstmt": false,
// true: Disallow any var statements. Only `let` and `const` are allowed.
// Relaxing
"asi": false,
// true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss": false,
// true: Tolerate assignments where comparisons would be expected
"debug": false,
// true: Allow debugger statements e.g. browser breakpoints.
"eqnull": false,
// true: Tolerate use of `== null`
"es5": true,
// true: Allow ES5 syntax (ex: getters and setters)
"esnext": false,
// true: Allow ES.next (ES6) syntax (ex: `const`)
"moz": false,
// true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil": false,
// true: Tolerate use of `eval` and `new Function()`
"expr": false,
// true: Tolerate `ExpressionStatement` as Programs
"funcscope": false,
// true: Tolerate defining variables inside control statements
"globalstrict": false,
// true: Allow global "use strict" (also enables 'strict')
"iterator": false,
// true: Tolerate using the `__iterator__` property
"lastsemic": false,
// true: Tolerate omitting a semicolon for the last statement of a 1-line block
"laxbreak": false,
// true: Tolerate possibly unsafe line breakings
"laxcomma": false,
// true: Tolerate comma-first style coding
"loopfunc": false,
// true: Tolerate functions being defined in loops
"multistr": false,
// true: Tolerate multi-line strings
"noyield": false,
// true: Tolerate generator functions with no yield statement in them.
"notypeof": false,
// true: Tolerate invalid typeof operator values
"proto": false,
// true: Tolerate using the `__proto__` property
"scripturl": false,
// true: Tolerate script-targeted URLs
"shadow": false,
// true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub": false,
// true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew": false,
// true: Tolerate `new function () { ... };` and `new Object;`
"validthis": false,
// true: Tolerate using this in a non-constructor function
// Environments
"browser": true,
// Web Browser (window, document, etc)
"browserify": false,
// Browserify (node.js code in the browser)
"couch": false,
// CouchDB
"devel": true,
// Development/debugging (alert, confirm, etc)
"dojo": false,
// Dojo Toolkit
"jasmine": false,
// Jasmine
"jquery": false,
// jQuery
"mocha": true,
// Mocha
"mootools": false,
// MooTools
"node": false,
// Node.js
"nonstandard": false,
// Widely adopted globals (escape, unescape, etc)
"phantom": false,
// PhantomJS
"prototypejs": false,
// Prototype and Scriptaculous
"qunit": false,
// QUnit
"rhino": false,
// Rhino
"shelljs": false,
// ShellJS
"typed": false,
// Globals for typed array constructions
"worker": false,
// Web Workers
"wsh": false,
// Windows Scripting Host
"yui": false,
// Yahoo User Interface
// Custom Globals
"globals": {},
// additional predefined global variables
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for JSHint[1], using JSHint example[2],
// Ory Band'updateText example[3], and haschek'updateText example[4] as basis and setting
// config values to be most strict:
//
// * set all enforcing options to true
// * set all relaxing options to false
// * set all environment options to false, except the browser value
// * set all JSLint legacy options to false
//
// NOTE: Certain exceptions were made for my own use. Understand what each
// deviation from what is described just above means for your project
//
// [1]: http://www.jshint.com/
// [2]: https://github.com/jshint/jshint/blob/master/examples/.jshintrc
// [3]: https://github.com/oryband/dotfiles/blob/master/.jshintrc
//
// @author http://michael.haschke.biz/
// @author Michael Scheer <[email protected]>
// @license http://unlicense.org/
//
//
// *******************
// NOTE: Modifications have been made to the original script found at:
// https://gist.github.com/haschek/2595796
// These modifications remove depreciated options and adding new
// ones as of v2.8.0
// *******************
//
//
// == Enforcing Options ===============================================
//
// These options tell JSHint to be more strict towards your code. Use
// them if you want to allow only a safe subset of JavaScript, very
// useful when your codebase is shared with a big number of developers
// with different skill levels.
"bitwise": true,
// Prohibit bitwise operators (&, |, ^, etc.).
"curly": true,
// Require { for every new block or scope.
"eqeqeq": true,
// Require triple equals i.e. `===`.
"es3": false,
// adhere to ECMAScript 3 specification -- Unneeded now and conflicts with promises
"es5": true,
// enables syntax first defined in the ECMAScript 5.1 specification.
"forin": true,
// Tolerate `for in` loops without `hasOwnPrototype`.
"freeze": true,
// Prohibits overwriting prototypes of native objects such as Array, Date and so on.
"funcscope": false,
// This option suppresses warnings about declaring variables inside of control structures while accessing them later from the outside.
"futurehostile": true,
// This option enables warnings about the use of identifiers which are defined in future versions of JavaScript.
"iterator": false,
// This option suppresses warnings about the __iterator__ property. This property is not supported by all browsers so use it carefully.
"latedef": true,
// Prohibit variable use before definition.
"maxcomplexity": 10,
// Lets you control cyclomatic complexity throughout your code
"maxdepth": 5,
// Lets you control how nested do you want your blocks to be
"maxerr": 20,
// Set the maximum amount of warnings JSHint will produce before giving up. Default is 50.
"maxparams": 4,
// Set the max number of formal parameters allowed per function
"maxstatements": 50,
// Set the max number of statements allowed per function:
"noarg": true,
// Prohibit use of `arguments.caller` and `arguments.callee`.
"nocomma": true,
// Prohibits the use of the comma operator.
"nonbsp": true,
// Warns about "non-breaking whitespace" characters.
"nonew": true,
// Prohibit use of constructors for side-effects.
"notypeof": false,
// suppresses warnings about invalid typeof operator values.
"shadow": false,
// suppresses warnings about variable shadowing
"singleGroups": true,
// This option prohibits the use of the grouping operator when it is not strictly required.
"strict": true,
// Require `use strict` pragma in every file.
"undef": true,
// Prohibits the use of explicitly undeclared variables.
"unused": true,
// warns when you define and never use your variables.
"varstmt": false,
// the use of VariableStatements are forbidden
// == Relaxing Options ================================================
//
// These options allow you to suppress certain types of warnings. Use
// them only if you are absolutely positive that you know what you are
// doing.
// ====================================================================
"asi": false,
// Tolerate Automatic Semicolon Insertion (no semicolons).
"boss": false,
// Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
"debug": false,
// Allow debugger statements e.g. browser breakpoints.
"eqnull": false,
// Tolerate use of `== null`.
"es5": false,
// Allow EcmaScript 5 syntax.
"esnext": true,
// Allow ES.next specific features such as `const` and `let`.
"evil": false,
// Tolerate use of `eval`.
"expr": false,
// Tolerate `ExpressionStatement` as Programs.
"funcscope": false,
// Tolerate declarations of variables inside of control structures while accessing them later from the outside.
"globalstrict": false,
// Allow global "use strict" (also enables 'strict').
"iterator": false,
// Allow usage of __iterator__ property.
"lastsemic": false,
// Tolerat missing semicolons when the it is omitted for the last statement in a one-line block.
"loopfunc": false,
// Allow functions to be defined within loops.
"onecase": false,
// Tolerate switches with just one case.
"proto": false,
// Tolerate __proto__ property. This property is deprecated.
"regexdash": false,
// Tolerate unescaped last dash i.e. `[-...]`.
"scripturl": false,
// Tolerate script-targeted URLs.
"smarttabs": false,
// Tolerate mixed tabs and spaces when the latter are used for alignmnent only.
"shadow": false,
// Allows re-define variables later in code e.g. `var x=1; x=2;`.
"supernew": false,
// Tolerate `new function () { ... ;` and `new Object;`.
"validthis": false,
// Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function.
// == Environments ====================================================
//
// These options pre-define global variables that are exposed by
// popular JavaScript libraries and runtime environments—such as
// browser or node.js.
// ====================================================================
"mocha": true,
// Mocha testing suite
"browser": true,
// Standard browser globals e.g. `window`, `document`.
"couch": false,
// Enable globals exposed by CouchDB.
"devel": false,
// Allow development statements e.g. `console.log();`.
"dojo": false,
// Enable globals exposed by Dojo Toolkit.
"jquery": false,
// Enable globals exposed by jQuery JavaScript library.
"mootools": false,
// Enable globals exposed by MooTools JavaScript framework.
"node": true,
// Enable globals available when code is running inside of the NodeJS runtime environment.
"nonstandard": false,
// Define non-standard but widely adopted globals such as escape and unescape.
"prototypejs": false,
// Enable globals exposed by Prototype JavaScript framework.
"rhino": false,
// Enable globals available when your code is running inside of the Rhino runtime environment.
"wsh": false,
// Enable globals available when your code is running as a script for the Windows Script Host.
// == Undocumented Options ============================================
//
// While I've found these options in [example1][2] and [example2][3]
// they are not described in the [JSHint Options documentation][4].
//
// [4]: http://www.jshint.com/options/
// ====================================================================
"predef": [
// Extra globals.
//"exampleVar",
//"anotherCoolGlobal",
//"iLoveDouglas"
],
"indent": 4,
// Specify indentation spacing
// Custom Override.
"camelcase": true,
"newcap": true,
"quotmark": "single",
"maxdepth": 3,
"maxlen": 120,
"eqnull": true,
"esnext": true,
"funcscope": true,
"multistr": true,
"node": true,
"jquery": true,
"predef": [
"define"
],
"disallowSpacesInAnonymousFunctionExpression": null,
"validateLineBreaks": "LF",
"validateIndentation": 4,
"excludeFiles": [
"build/**",
"node_modules/**"
],
"esprima": "esprima-fb"
}