New: the prefer-reflect rule (fixes #2939) - #2996
Conversation
|
Overall looks good. I would like to change the options to be more in line with how we've defined exceptions in other rules. I can see two possible options: Kinda leaning towards the second, but could be convinced otherwise. |
|
@nzakas The second permits a tri-state with different falsey values (false and undefined) meaning different things. That's not a good interface in my opinion. |
|
I went more inline with a ruleset similar to |
|
Rebased, fixed tests and changed rule options to be |
|
io.js travis build seems to be stuck, but I cant stop or restart it: https://travis-ci.org/eslint/eslint/jobs/71037738 |
|
Failure is down to travis timing out trying to install iojs:
Force pushed to trigger a new build. Should pass now. |
|
Oops, forgot to update docs in respect to change to using Docs updated now. This should be good to go. |
|
Added jsdoc block for @nzakas is there anything else you'd like me to change? |
|
Fixed lint errors JSDoc. |
There was a problem hiding this comment.
Can you use options instead of args?
options: [{exceptions: "apply"}]
You can leave off the initial 2, and any place with args: 2 can just be removed.
|
All done @nzakas. Anything else? |
There was a problem hiding this comment.
I think there's an extra closing brace inside the array and one missing at the end of the line.
|
LGTM. Btw, awesome documentation! |
|
😄 thanks @ilyavolodin |
There was a problem hiding this comment.
Closing square brace is in the wrong place.
|
Can you rebase? |
|
Rebased @nzakas |
|
Thanks @keithamus for sticking with this! |
New: the `prefer-reflect` rule (fixes #2939)
|
🎉 |
This PR adds a rule to warn when the user is using "effectively deprecated" methods - which Reflect.* replaces, as discussed in #2939. Fixes #2939.
As the docs/tests suggest, each section can be disabled - meaning the user can configure this how they need to, for example if they want to use reflect for all but the
deleteoperator, then they can configure it as[2, "delete"].Let me know if you need anything else from me to merge this.
Oh, also, so close!
