-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc
137 lines (137 loc) · 4.13 KB
/
.eslintrc
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
/* Credits: Mobify https://github.com/mobify/mobify-code-style/blob/master/javascript/.eslintrc */
{
"extends": "./.eslintrc-reset",
"ecmaFeatures": {
"blockBindings": true,
},
"env": {
"node": true,
"browser": true,
"amd": true,
"mocha": true,
"jquery": true
},
"globals": {
"Mobify": true,
"Zepto": true,
"Adaptive": true
},
"rules": {
// K&R brace style, e.g. `if (x) {` <-- no new line before {
"brace-style": [
2,
"1tbs",
{
"allowSingleLine": true
}
],
// Enforce === instead of ==; !== instead of !=
"eqeqeq": 2,
// Enforce if statement within 'for in'
"guard-for-in": 2,
// Disallow overwriting native types like 'Array' or 'Date'
"no-extend-native": 2,
// Enforce wrapping immediate invocations in parentheses
"wrap-iife": [
2,
"inside"
],
// Disallow usage of a variable before declaration; ignores functions
"no-use-before-define": [
2,
"nofunc"
],
// Enforce capitalization of constructor functions
"new-cap": 2,
// Disallow creation of dense arrays using the Array constructor
"no-array-constructor": 2,
// Disallow use of the Object constructor
"no-new-object": 2,
// Disallow use of argument.caller and argument.callee
"no-caller": 2,
// Disallow empty block statements
"no-empty": 2,
// Disallow use of the with statement
"no-with": 2,
// Disallow mixed spaces and tabs for indentation
"no-mixed-spaces-and-tabs": 2,
// Enforce 4 spaces indentation
"indent": [
2,
4,
{
"SwitchCase": 1
}
],
// Disallow use of multiline strings
"no-multi-str": 2,
// Warn if variables are not named with camelCase
"camelcase": 1,
// Disallow trailing whitespace at the end of lines
"no-trailing-spaces": 2,
// Disallow spacing before commas; enforce spacing after commas
"comma-spacing": [
2,
{
"before": false,
"after": true
}
],
// Enforce spacing after keywords: if, else, for, while, do, switch, try,
// catch, and finally
"space-after-keywords": 2,
// Enforce spacing before opening brace of block statements
"space-before-blocks": [
2,
"always"
],
// Disallow spaces before function parentheses
"space-before-function-paren": [
2,
"never"
],
// Enforce spaceing around infix operators: +, -, :, ?
"space-infix-ops": 2,
// Enforce spacing around word unary operators: new, delete, typeof, void
// Disallow spacing around non-word unary operators: -, +, --, ++, !, !!
"space-unary-ops": [
2,
{
"words": true,
"nonwords": false
}
],
// Warn if undeclared variables
"no-undef": 1,
// Warn if single newline at end of file is missing
"eol-last": 1,
// Enforce single quotes for string literals
"quotes": [
2,
"single"
],
// Disallow unnecessary semicolons
"no-extra-semi": 2,
// Disallow function or variable declarations in nested blocks
"no-inner-declarations": 2,
// Disallows the nesting of blocks more than 5 deep
"max-depth": [
2,
5
],
// Enforces a maximum of 100 characters in a single line; adjusts tabs
// to equal 4 characters
"max-len": [
2,
300,
4
],
// Enforces semicolons at the end of statements
"semi": 2,
// Disallow function definitions of the form 'function myFunc() {'
"func-style": [
2,
"expression"
]
}
}