-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[deprecation] Warns when deprecated APIs are used. #1223
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
Comments
Related: https://github.com/SonarSource/SonarJS/issues/1432, SonarSource/SonarJS#1715
|
Now that this rule was implemented and merged in SonarJS - are there any plans to bring this to |
We don't have any. If someone wants to PR it, we would be happy to review it. |
I believe it's just a matter of copy-pasting this rule from |
It's not quite as simple as a copy paste job, as that code has its own licence. Also, the code would have to be updated to fit our coding standards in this repo, as the style is reasonably different. |
Well However, it is possible to port that rule into eslint plugin (say Maybe it makes more sense to just create another repo for this rule? |
If someone wants to port the rule to an independent eslint plugin, feel free! |
Alright, I've ported the rule into separate plugin https://github.com/gund/eslint-plugin-deprecation |
happy if you update the docs to point at your plugin, and then we can consider this closed. (note the docs currently point at an eslint-plugin-import rule, which is not as good as a rule using typescript types, like your ported rule does) |
Thank you @gund! If someone stumbles upon this, I think t would still be cool to have a port of the tslint implementation (as suggested by @bradzacher) in this repo due to licensing reasons and for fewer dependencies. |
Repro
Expected Result
In both cases there should be a warning, that the function or property are depricated.
Actual Result
The
@depricated
comments are ignored.Additional Info
There is a TSLint Rule:
deprication
and a long discussion at the TypeScript BugtrackerI did not check the implementation for TSLint, but there are many things to consider. They should be configurable.
private
orprotected
property is marked as depricated. (at least private properties should be updated as soon as a property is depricated)@depricated
tag must be followed by an explanation and/or alternative.The text was updated successfully, but these errors were encountered: