-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.jshintrc
66 lines (63 loc) · 3.91 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
{
"bitwise": true, //prevent bitwise operations as they"re usually not needed
"camelcase": true, //force variable/member name to be camelCased
"curly": true, //force curly braces around all conditionals
"eqeqeq": true, //for ===/!== instead of ==/!=
"es3": false, //we support ES5 and above, no need for this
"forin": true, //for in loops should make sure to filter items to not get prototype data
"immed": true, //immediate function invocations need to be wrapped in parentheses for readability
"indent": 2, //all application should should be indenting 4 spaces
"latedef": true, //make sure variables are define before use for readability
"newcap": true, //function constructors should be PascalCase
"noarg": true, //this is a work around for a problem that no longer exists
"noempty": true,
"nonew": false, //while we should prefer prototypal inheritance, I am no convince the there is no reason not to use function constructors
"plusplus": true, //just use += 1 or -= 1 for readability
"quotmark": false, //since sometimes you need either double or single quote inside the signle, both should be allowed to avoid havingt to escape
"undef": true, //there is on reason to use an undefined variable
"unused": false,
"strict": false, //not stardard enough to safely use I think
"trailing": true, //there is no reason to have a trailing space
"maxparams": 20, //set so high because of DI with angular can cause a lot of parameters but should never be more then 20
"maxdepth": 3, //more than 3 levels of depth for a function and we should look at refacting the code
"maxstatements": 40, //more than 40 statements per function and we should look at refactoring the code
"maxlen": 160, //line should be no longer than 160 characters
"asi": false, //we always want to show semi-solon warnings
"boss": false, //we always want to show warnings about assignments happening where comparisons are expected
"debug": false, //we should never have debugger code when linting code (which should only happen when building for for production)
"eqnull": false, //we want to show warnings where we have == null to make it more defined to prevent weird things from happening
"esnext": false, //we are not using ES6 code
"evil": false, //we should not be using eval
"expr": true, //this will causes warning for our tests if set to false
"funcscope": true, //we can declare variable anywhere we want, I don"t think there is any real disadvantage (and ES6 is getting block level scope)
"globalstrict": true, //not sure what this is so let not worry about it
"iterator": false, //__iterator__ is not available in all browsers so it should not be used
"lastsemic": false, //we want to know about missing semi-colon everywhere they should be
"laxbreak": true, //allows line breaks anywhere you want
"laxcomma": false, //commas should never be at the beginning of the line,
"loopfunc": false, //this can help identifiy place where a closure need to be added to avoid bugs
"moz": false, //we are not using mozillajavascript extensions
"multistr": false, //there is no reasn for multi-lines strings
"proto": false, //sticking with what I think is the default
"scripturl": false, //sticking with what I think is the default
"smarttabs": false, //sticking with what I think is the default
"shadow": false, //sticking with what I think is the default
"sub": true, //allows array accessor where dot notation might be cleaner (obj["test"] vs obj.test)
"supernew": false, //sticking with what I think is the default
"validthis": true, //strict mode related so we don"t need to warnings to show up
//helps define some globals
"browser": true,
"jquery": true,
"globals": {
//library/helper globals
"_": false, // lodash"s global
"angular": false, // angular"s global
//testing globals
"it": false,
"expect": false,
"describe": false,
"beforeEach": false,
"module": false,
"inject": false
}
}