Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I havesearched for related issues and found none that match my proposal.
- I have searched thecurrent rule list and found no rules that match my proposal.
- I haveread the FAQ and my problem is not listed.
My proposal is suitable for this project
- My proposal specifically checks TypeScript syntax, or it proposes a check that requires type information to be accurate.
- My proposal is not a "formatting rule"; meaning it does not just enforce how code is formatted (whitespace, brace placement, etc).
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
Re-opening#1223: being able to lint against usage of an API marked as@deprecated
is a common request for TypeScript developers. It was aTSLint rule back in those days, and now is provided primarily byhttps://github.com/gund/eslint-plugin-deprecation.eslint-plugin-deprecation
existing is why#1223 was closed by a docs change pointing folks externally.
But! Since then:
- We've stabilized as a repository and IMO this is an important + often-useful enough rule to justify being included (so folks don't have to use a third-party plugin)
eslint-plugin-deprecation
isn't 100% actively maintained, and has anissue template notice indicating its maintainer doesn't have the bandwidth to ramp up on it & actively fix issues
Proposal: let's write a new implementation of adeprecation
rule in this repo?
Fail Cases
/**@deprecated */declarefunctionv1():unknown;v1();
Pass Cases
declarefunctionv2():unknown;v2();
Additional Info
Note that the licensing here is tricky.https://github.com/gund/eslint-plugin-deprecation includes the following README.md note:
This rule was originally ported from theSonarJS repository.
...and is licensed under the GNU Lesser General Public License.
We need to be very sure that if this issue is accepted, any code added to our project isnot based on the GNU license, and is at most licensed under MIT. If this is accepted, I think a member of the typescript-eslint team should work on it.
Other references of related licensed rules are:
- https://github.com/import-js/eslint-plugin-import/blob/f77ceb679d59ced5d9a633123385470a9eea10d9/src/rules/no-deprecated.js (MIT)
- https://palantir.github.io/tslint/rules/deprecation (Apache-2.0)
cc@gund - you've done a great job for a while of keepingeslint-plugin-deprecation
afloat ❤️. If you have any thoughts here, that'd be great.