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 = {
3030 2 ,
3131 // Experimental object/rest spread (not in ES 2015)
3232 'ExperimentalRestProperty'
33- ] ,
34-
35- // Suggest using Reflect API where applicable
36- 'prefer-reflect' : 1
33+ ]
3734 }
3835}
Original file line number Diff line number Diff line change @@ -211,8 +211,16 @@ module.exports = {
211211 // modified after the initial assignment. This helps v8 to better optimise code at runtime.
212212 'prefer-const' : 1 ,
213213
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+ } ] ,
216224
217225 // Suggest using the spread operator instead of .apply()
218226 // 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