-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add rule no-deprecated #182
base: master
Are you sure you want to change the base?
Conversation
Hey, and thanks for contributing! |
@ganimomer thanks for advice, i will make appropriate changes |
@ganimomer i updated the rule to no-deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
I made some comments about the spec and implementation, which I think should be changed a bit.
|
||
This rule takes two arguments. | ||
|
||
* severity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In all other rules, we don't count severity as an argument.
@@ -0,0 +1,15 @@ | |||
# Prevent use of deperectaed or future deprecations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a typo in deprecated
.
This rule takes two arguments. | ||
|
||
* severity | ||
* array of lodash versions e.g. [4,5] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this is an array.
Whoever uses this rule probably wants to migrate to a specific version, so they can probably input their destination version, and the rule can figure out which deprecations to include by itself.
e.g. If a user uses v3 (which we can get by the version
global config, usually supplied by using a config), and they want to upgrade to v5, they can just write 5
and the rule can figure out to include both 4
and 5
as deprecations.
@@ -0,0 +1,34 @@ | |||
'use strict' | |||
module.exports = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin already has a methodDataByVersion
files. Maybe there's a way to introduce this data there, so all the information is in the same place?
Most of the information is already there - any method that exists in 3
and doesn't exist in 4
is deprecated.
This means we'd have to add a 5.js
already, but assuming you can run the master
version of Lodash in Node, you can probably use a script to generate a file for it automatically. You don't even need to add all the information yet (that's subject to change until v5
is released probably). You can just use empty object for each method.
This might not include the recommendation part, but it's neater, I think.
bind: 'use built-in functions', | ||
bindAll: 'use built-in functions', | ||
rest: 'use built-in functions', | ||
spread: 'use built-in functions', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest/spread are built-in syntax (not functions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdalton i will update it, i didn't miss any deperecation right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good start. It can always be added to as v5 develops.
@ganimomer i am thinking to add deprecations list in
|
@abhirathore2006 Sounds good, but why the |
@ganimomer to distinguish it from other properties, which are the names of actual functions |
Adding support no-deprecated rule to make migration to newer version easier