-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.jshint-groups.js
More file actions
112 lines (101 loc) · 4.93 KB
/
.jshint-groups.js
File metadata and controls
112 lines (101 loc) · 4.93 KB
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
var files = {
js: [
'classes.js',
'quality_control/*.js'
],
test: [
'tests/*.js',
'tests/**/*.js'
]
},
excludeForTech = function(tech) {
var keys = Object.keys(files),
excludes = [];
for (var i = 0, l = keys.length; i < l; i++) {
if (keys[i] !== tech) {
excludes = excludes.concat(files[keys[i]]);
}
}
return excludes;
};
module.exports = {
options: {
maxerr: 50, // Maximum error before stopping
eqeqeq: true, // Require triple equals (===) for comparison
forin: true, // Require filtering for..in loops with obj.hasOwnProperty()
immed: true, // Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
indent: 4, // Number of spaces to use for indentation
maxdepth: 4, // Max depth of nested blocks (within functions)
maxparams: 4, // Max number of formal params allowed per function
maxstatements: false, // Max number statements per function
maxcomplexity: false, // Max cyclomatic complexity per function
newcap: true, // Require capitalization of all constructor functions e.g. `new F()`
noarg: true, // Prohibit use of `arguments.caller` and `arguments.callee`
noempty: true, // Prohibit use of empty blocks
nonew: true, // Prohibit use of constructors for side-effects (without assignment)
quotmark: 'single', // Quotation mark consistency
trailing: true, // Prohibit trailing whitespaces
undef: true, // Require all non-global variables to be declared (prevents global leaks)
unused: true, // Require all defined variables be used
// Relaxing
asi: false, // Tolerate Automatic Semicolon Insertion (no semicolons)
boss: false, // Tolerate assignments where comparisons would be expected
debug: false, // Allow debugger statements e.g. browser breakpoints.
eqnull: false, // Tolerate use of `== null`
es5: false, // Allow ES5 syntax (ex: getters and setters)
esnext: false, // Allow ES.next (ES6) syntax (ex: `const`)
moz: false, // Allow Mozilla specific syntax (extends and overrides esnext features)
evil: false, // Tolerate use of `eval` and `new Function()`
expr: true, // Tolerate `ExpressionStatement` as Programs
funcscope: false, // Tolerate defining variables inside control statements
globalstrict: false, // Allow global use strict (also enables 'strict')
iterator: false, // Tolerate using the `__iterator__` property
lastsemic: false, // Tolerate omitting a semicolon for the last statement of a 1-line block
laxbreak: true, // Tolerate possibly unsafe line breakings
laxcomma: false, // Tolerate comma-first style coding
loopfunc: false, // Tolerate functions being defined in loops
multistr: false, // Tolerate multi-line strings
proto: false, // Tolerate using the `__proto__` property
scripturl: false, // Tolerate script-targeted URLs
smarttabs: false, // Tolerate mixed tabs/spaces when used for alignment
shadow: false, // Allows re-define variables later in code e.g. `var x=1; x=2;`
sub: false, // Tolerate using `[]` notation when it can still be expressed in dot notation
supernew: true, // Tolerate `new function () { ... };` and `new Object;`
validthis: false, // Tolerate using this in a non-constructor function
// Environments
devel: false, // Development/debugging (alert, confirm, etc)
nonstandard: false, // Widely adopted globals (escape, unescape, etc)
// Custom Globals
globals: {} // additional predefined global variables
},
groups: {
js: {
options: {
node: true,
sub: true
},
includes: files.js,
excludes: excludeForTech('js')
},
test: {
options: {
node: true,
predef: [
'_',
'after',
'afterEach',
'assert',
'before',
'beforeEach',
'describe',
'it',
'sinon',
'getClasses'
],
sub: true
},
includes: files.test,
excludes: excludeForTech('test')
}
}
};