Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
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
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Link to the rule's documentation
https://typescript-eslint.io/rules/no-deprecated/
Description
I find it very useful to flag and address deprecated API usage during the dependency upgrade cycle. Whence I'd like to enforce the rule for the usage of my dependencies.
However, for my own code base I want to follow a gradual deprecation cycle, i.e. I want to introduce an updated API and inform users writing new code about the updated API via a@deprecated
JSDoc comment. Afterwards I'd phase the deprecated API out and remove it in the end.
The current rule is unsuited for the combined requirements, so I propose a boolean optionignoreUserDeprecations
.
Fail
/**@deprecated Use apiV2 instead. */asyncfunctionapiV1():Promise<void>{/*…*/}asyncfunctionapiV2():Promise<void>{/*…*/}awaitapiV1();/* >===================================< */import{parse}from'node:url';// 'parse' is deprecated. Use the WHATWG URL API instead.consturl=parse('/foo');
Pass
/**@deprecated Use apiV2 instead. */asyncfunctionapiV1():Promise<void>{/*…*/}asyncfunctionapiV2():Promise<void>{/*…*/}// apiV1 has been defined in the current code base and is therefore not flaggedawaitapiV1();/* >===================================< */// Modern Node.js API, uses `new URL()`consturl2=newURL('/foo','http://www.example.com');
Additional Info
Originally proposed in the [no-deprecated] issue#8988 (comment)
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin