1
1
module . exports = {
2
2
rules : {
3
3
// enforces getter/setter pairs in objects
4
- 'accessor-pairs' : 0 ,
4
+ 'accessor-pairs' : 'off' ,
5
5
6
6
// enforces return statements in callbacks of array's methods
7
7
// http://eslint.org/docs/rules/array-callback-return
8
- 'array-callback-return' : 2 ,
8
+ 'array-callback-return' : 'error' ,
9
9
10
10
// treat var statements as if they were block scoped
11
- 'block-scoped-var' : 2 ,
11
+ 'block-scoped-var' : 'error' ,
12
12
13
13
// specify the maximum cyclomatic complexity allowed in a program
14
- complexity : [ 0 , 11 ] ,
14
+ complexity : [ 'off' , 11 ] ,
15
15
16
16
// require return statements to either always or never specify values
17
- 'consistent-return' : 2 ,
17
+ 'consistent-return' : 'error' ,
18
18
19
19
// specify curly brace conventions for all control statements
20
- curly : [ 2 , 'multi-line' ] ,
20
+ curly : [ 'error' , 'multi-line' ] ,
21
21
22
22
// require default case in switch statements
23
- 'default-case' : [ 2 , { commentPattern : '^no default$' } ] ,
23
+ 'default-case' : [ 'error' , { commentPattern : '^no default$' } ] ,
24
24
25
25
// encourages use of dot notation whenever possible
26
- 'dot-notation' : [ 2 , { allowKeywords : true } ] ,
26
+ 'dot-notation' : [ 'error' , { allowKeywords : true } ] ,
27
27
28
28
// enforces consistent newlines before or after dots
29
29
// http://eslint.org/docs/rules/dot-location
30
- 'dot-location' : [ 2 , 'property' ] ,
30
+ 'dot-location' : [ 'error' , 'property' ] ,
31
31
32
32
// require the use of === and !==
33
33
// http://eslint.org/docs/rules/eqeqeq
34
- eqeqeq : [ 2 , 'allow-null' ] ,
34
+ eqeqeq : [ 'error' , 'allow-null' ] ,
35
35
36
36
// make sure for-in loops have an if statement
37
- 'guard-for-in' : 2 ,
37
+ 'guard-for-in' : 'error' ,
38
38
39
39
// disallow the use of alert, confirm, and prompt
40
- 'no-alert' : 1 ,
40
+ 'no-alert' : 'warn' ,
41
41
42
42
// disallow use of arguments.caller or arguments.callee
43
- 'no-caller' : 2 ,
43
+ 'no-caller' : 'error' ,
44
44
45
45
// disallow lexical declarations in case/default clauses
46
46
// http://eslint.org/docs/rules/no-case-declarations.html
47
- 'no-case-declarations' : 2 ,
47
+ 'no-case-declarations' : 'error' ,
48
48
49
49
// disallow division operators explicitly at beginning of regular expression
50
50
// http://eslint.org/docs/rules/no-div-regex
51
- 'no-div-regex' : 0 ,
51
+ 'no-div-regex' : 'off' ,
52
52
53
53
// disallow else after a return in an if
54
- 'no-else-return' : 2 ,
54
+ 'no-else-return' : 'error' ,
55
55
56
56
// disallow empty functions, except for standalone funcs/arrows
57
57
// http://eslint.org/docs/rules/no-empty-function
58
- 'no-empty-function' : [ 2 , {
58
+ 'no-empty-function' : [ 'error' , {
59
59
allow : [
60
60
'arrowFunctions' ,
61
61
'functions' ,
@@ -65,37 +65,37 @@ module.exports = {
65
65
66
66
// disallow empty destructuring patterns
67
67
// http://eslint.org/docs/rules/no-empty-pattern
68
- 'no-empty-pattern' : 2 ,
68
+ 'no-empty-pattern' : 'error' ,
69
69
70
70
// disallow comparisons to null without a type-checking operator
71
- 'no-eq-null' : 0 ,
71
+ 'no-eq-null' : 'off' ,
72
72
73
73
// disallow use of eval()
74
- 'no-eval' : 2 ,
74
+ 'no-eval' : 'error' ,
75
75
76
76
// disallow adding to native types
77
- 'no-extend-native' : 2 ,
77
+ 'no-extend-native' : 'error' ,
78
78
79
79
// disallow unnecessary function binding
80
- 'no-extra-bind' : 2 ,
80
+ 'no-extra-bind' : 'error' ,
81
81
82
82
// disallow Unnecessary Labels
83
83
// http://eslint.org/docs/rules/no-extra-label
84
- 'no-extra-label' : 2 ,
84
+ 'no-extra-label' : 'error' ,
85
85
86
86
// disallow fallthrough of case statements
87
- 'no-fallthrough' : 2 ,
87
+ 'no-fallthrough' : 'error' ,
88
88
89
89
// disallow the use of leading or trailing decimal points in numeric literals
90
- 'no-floating-decimal' : 2 ,
90
+ 'no-floating-decimal' : 'error' ,
91
91
92
92
// disallow reassignments of native objects or read-only globals
93
93
// http://eslint.org/docs/rules/no-global-assign
94
- 'no-global-assign' : [ 2 , { exceptions : [ ] } ] ,
94
+ 'no-global-assign' : [ 'error' , { exceptions : [ ] } ] ,
95
95
96
96
// disallow implicit type conversions
97
97
// http://eslint.org/docs/rules/no-implicit-coercion
98
- 'no-implicit-coercion' : [ 0 , {
98
+ 'no-implicit-coercion' : [ 'off' , {
99
99
boolean : false ,
100
100
number : true ,
101
101
string : true ,
@@ -104,137 +104,137 @@ module.exports = {
104
104
105
105
// disallow var and named functions in global scope
106
106
// http://eslint.org/docs/rules/no-implicit-globals
107
- 'no-implicit-globals' : 0 ,
107
+ 'no-implicit-globals' : 'off' ,
108
108
109
109
// disallow use of eval()-like methods
110
- 'no-implied-eval' : 2 ,
110
+ 'no-implied-eval' : 'error' ,
111
111
112
112
// disallow this keywords outside of classes or class-like objects
113
- 'no-invalid-this' : 0 ,
113
+ 'no-invalid-this' : 'off' ,
114
114
115
115
// disallow usage of __iterator__ property
116
- 'no-iterator' : 2 ,
116
+ 'no-iterator' : 'error' ,
117
117
118
118
// disallow use of labels for anything other then loops and switches
119
- 'no-labels' : [ 2 , { allowLoop : false , allowSwitch : false } ] ,
119
+ 'no-labels' : [ 'error' , { allowLoop : false , allowSwitch : false } ] ,
120
120
121
121
// disallow unnecessary nested blocks
122
- 'no-lone-blocks' : 2 ,
122
+ 'no-lone-blocks' : 'error' ,
123
123
124
124
// disallow creation of functions within loops
125
- 'no-loop-func' : 2 ,
125
+ 'no-loop-func' : 'error' ,
126
126
127
127
// disallow magic numbers
128
128
// http://eslint.org/docs/rules/no-magic-numbers
129
- 'no-magic-numbers' : [ 0 , {
129
+ 'no-magic-numbers' : [ 'off' , {
130
130
ignore : [ ] ,
131
131
ignoreArrayIndexes : true ,
132
132
enforceConst : true ,
133
133
detectObjects : false ,
134
134
} ] ,
135
135
136
136
// disallow use of multiple spaces
137
- 'no-multi-spaces' : 2 ,
137
+ 'no-multi-spaces' : 'error' ,
138
138
139
139
// disallow use of multiline strings
140
- 'no-multi-str' : 2 ,
140
+ 'no-multi-str' : 'error' ,
141
141
142
142
// disallow reassignments of native objects
143
143
// TODO: deprecated in favor of no-global-assign
144
- 'no-native-reassign' : 0 ,
144
+ 'no-native-reassign' : 'off' ,
145
145
146
146
// disallow use of new operator when not part of the assignment or comparison
147
- 'no-new' : 2 ,
147
+ 'no-new' : 'error' ,
148
148
149
149
// disallow use of new operator for Function object
150
- 'no-new-func' : 2 ,
150
+ 'no-new-func' : 'error' ,
151
151
152
152
// disallows creating new instances of String, Number, and Boolean
153
- 'no-new-wrappers' : 2 ,
153
+ 'no-new-wrappers' : 'error' ,
154
154
155
155
// disallow use of (old style) octal literals
156
- 'no-octal' : 2 ,
156
+ 'no-octal' : 'error' ,
157
157
158
158
// disallow use of octal escape sequences in string literals, such as
159
159
// var foo = 'Copyright \251';
160
- 'no-octal-escape' : 2 ,
160
+ 'no-octal-escape' : 'error' ,
161
161
162
162
// disallow reassignment of function parameters
163
163
// disallow parameter object manipulation
164
164
// rule: http://eslint.org/docs/rules/no-param-reassign.html
165
- 'no-param-reassign' : [ 2 , { props : true } ] ,
165
+ 'no-param-reassign' : [ 'error' , { props : true } ] ,
166
166
167
167
// disallow usage of __proto__ property
168
- 'no-proto' : 2 ,
168
+ 'no-proto' : 'error' ,
169
169
170
170
// disallow declaring the same variable more then once
171
- 'no-redeclare' : 2 ,
171
+ 'no-redeclare' : 'error' ,
172
172
173
173
// disallow use of assignment in return statement
174
- 'no-return-assign' : 2 ,
174
+ 'no-return-assign' : 'error' ,
175
175
176
176
// disallow use of `javascript:` urls.
177
- 'no-script-url' : 2 ,
177
+ 'no-script-url' : 'error' ,
178
178
179
179
// disallow self assignment
180
180
// http://eslint.org/docs/rules/no-self-assign
181
- 'no-self-assign' : 2 ,
181
+ 'no-self-assign' : 'error' ,
182
182
183
183
// disallow comparisons where both sides are exactly the same
184
- 'no-self-compare' : 2 ,
184
+ 'no-self-compare' : 'error' ,
185
185
186
186
// disallow use of comma operator
187
- 'no-sequences' : 2 ,
187
+ 'no-sequences' : 'error' ,
188
188
189
189
// restrict what can be thrown as an exception
190
- 'no-throw-literal' : 2 ,
190
+ 'no-throw-literal' : 'error' ,
191
191
192
192
// disallow unmodified conditions of loops
193
193
// http://eslint.org/docs/rules/no-unmodified-loop-condition
194
- 'no-unmodified-loop-condition' : 0 ,
194
+ 'no-unmodified-loop-condition' : 'off' ,
195
195
196
196
// disallow usage of expressions in statement position
197
- 'no-unused-expressions' : [ 2 , {
197
+ 'no-unused-expressions' : [ 'error' , {
198
198
allowShortCircuit : false ,
199
199
allowTernary : false ,
200
200
} ] ,
201
201
202
202
// disallow unused labels
203
203
// http://eslint.org/docs/rules/no-unused-labels
204
- 'no-unused-labels' : 2 ,
204
+ 'no-unused-labels' : 'error' ,
205
205
206
206
// disallow unnecessary .call() and .apply()
207
- 'no-useless-call' : 0 ,
207
+ 'no-useless-call' : 'off' ,
208
208
209
209
// disallow useless string concatenation
210
210
// http://eslint.org/docs/rules/no-useless-concat
211
- 'no-useless-concat' : 2 ,
211
+ 'no-useless-concat' : 'error' ,
212
212
213
213
// disallow unnecessary string escaping
214
214
// http://eslint.org/docs/rules/no-useless-escape
215
- 'no-useless-escape' : 2 ,
215
+ 'no-useless-escape' : 'error' ,
216
216
217
217
// disallow use of void operator
218
218
// http://eslint.org/docs/rules/no-void
219
- 'no-void' : 2 ,
219
+ 'no-void' : 'error' ,
220
220
221
221
// disallow usage of configurable warning terms in comments: e.g. todo
222
- 'no-warning-comments' : [ 0 , { terms : [ 'todo' , 'fixme' , 'xxx' ] , location : 'start' } ] ,
222
+ 'no-warning-comments' : [ 'off' , { terms : [ 'todo' , 'fixme' , 'xxx' ] , location : 'start' } ] ,
223
223
224
224
// disallow use of the with statement
225
- 'no-with' : 2 ,
225
+ 'no-with' : 'error' ,
226
226
227
227
// require use of the second argument for parseInt()
228
- radix : 2 ,
228
+ radix : 'error' ,
229
229
230
230
// requires to declare all vars on top of their containing scope
231
- 'vars-on-top' : 2 ,
231
+ 'vars-on-top' : 'error' ,
232
232
233
233
// require immediate function invocation to be wrapped in parentheses
234
234
// http://eslint.org/docs/rules/wrap-iife.html
235
- 'wrap-iife' : [ 2 , 'outside' ] ,
235
+ 'wrap-iife' : [ 'error' , 'outside' ] ,
236
236
237
237
// require or disallow Yoda conditions
238
- yoda : 2
238
+ yoda : 'error'
239
239
}
240
240
} ;
0 commit comments