This repository was archived by the owner on Mar 7, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,6 @@ module.exports = {
30
30
2 ,
31
31
// Experimental object/rest spread (not in ES 2015)
32
32
'ExperimentalRestProperty'
33
- ] ,
34
-
35
- // Suggest using Reflect API where applicable
36
- 'prefer-reflect' : 1
33
+ ]
37
34
}
38
35
}
Original file line number Diff line number Diff line change @@ -211,8 +211,16 @@ module.exports = {
211
211
// modified after the initial assignment. This helps v8 to better optimise code at runtime.
212
212
'prefer-const' : 1 ,
213
213
214
- // Suggest using Reflect methods where applicable
215
- 'prefer-reflect' : 1 ,
214
+ // Suggest using Reflect API where applicable
215
+ // Note that it's better to use `delete`, `call()` and `.apply()` directly because they will
216
+ // throw an exception if there's something wrong with them (especially in the case of `delete`)
217
+ 'prefer-reflect' : [ 1 , {
218
+ exceptions : [
219
+ 'apply' ,
220
+ 'call' ,
221
+ 'delete'
222
+ ]
223
+ } ] ,
216
224
217
225
// Suggest using the spread operator instead of .apply()
218
226
// This rule is aimed to flag usage of Function.prototype.apply() that can be replaced with the
You can’t perform that action at this time.
0 commit comments